Auto sync2gitlab import of mcpp-2.7.2-20.el8.src.rpm

This commit is contained in:
James Antill 2022-05-26 11:20:41 -04:00
parent 62223358da
commit 801c644fa0
7 changed files with 606 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/mcpp-2.7.2.tar.gz

1
EMPTY
View File

@ -1 +0,0 @@

177
mcpp-man.patch Normal file
View File

@ -0,0 +1,177 @@
diff -up ./mcpp.1~ ./mcpp.1
--- ./mcpp.1~ 2008-03-03 16:33:05.000000000 +0100
+++ ./mcpp.1 2013-06-20 19:07:47.235509194 +0200
@@ -26,6 +26,8 @@ special 'post-Standard' mode.
K&R 1st mode.
.IP " \fB-@oldprep, -@old"
"old_preprocessor" mode (i.e. "Reiser model" cpp).
+.IP " \fB-@compat"
+Standard 'compatible' mode.
.IP \fB-C
Output also comments.
.IP "\fB-D <macro>[=<value>]"
@@ -43,8 +43,16 @@ Add <directory> to the #include search l
Unset system or site specific include directories.
.IP \fB-j
Do not output the source line in diagnostics.
+.IP \fB-k
+Keep white spaces of input lines as they are.
.IP "\fB-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file"
Output source file dependency line for makefile.
+.IP \fB-m32
+Change target CPU from x86_64, ppc64 to i386, ppc, respectively.
+.IP \fB-m64
+Change target CPU from i386, ppc to x86_64, ppc64, respectively.
+.IP \fB-[no-]mmx
+(Un-)define __MMX__.
.IP \fB-N
Don't predefine any non-standard macros.
.IP "\fB-o <file>"
diff -up ./mcpp-gcc.1~ ./mcpp-gcc.1
--- ./mcpp-gcc.1~ 2008-03-03 17:31:29.000000000 +0100
+++ ./mcpp-gcc.1 2013-06-20 19:15:24.016019498 +0200
@@ -16,6 +16,8 @@ and \fI<outfile>\fR defaults to standard
It takes the following options.
.PP
Commonly used options:
+.IP "\fB-$, -fno-dollars-in-identifiers"
+Forbid '$' in identifiers.
.IP \fB-@MODE
Specify preprocessing mode. MODE should be one of these 4:
.IP " \fB-@std"
@@ -26,6 +28,8 @@ special 'post-Standard' mode.
K&R 1st mode.
.IP " \fB-@oldprep, -@old"
"old_preprocessor" mode (i.e. "Reiser model" cpp).
+.IP " \fB-@compat"
+Standard 'compatible' mode.
.IP \fB-b
Output #line lines in C source style (default: GCC style).
.IP \fB-C
@@ -34,21 +38,43 @@ Output also comments.
Define <macro> as <value> (default:1).
.IP "\fB-D <macro(args)>[=<replace>]"
Define <macro(args)> as <replace>.
+.IP "\fB-dM, -dD"
+Dump all current macro definitions to output stream.
.IP "\fB-e <encoding>"
Change the default multi-byte character encoding to one of:
euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.
.IP \fB-finput-charset=<encoding>
Same as -e <encoding>. (Do not insert spaces around '=').
+.IP \fB-f[no-]working-directory
+(Don't) emit #line marks with current working directory.
+.IP \fB-fstack-protector[-all]
+Add defines for GCC stack protector.
+.IP \fB-f[no-]exceptions
+(Don't) add define for exception support.
+.IP "\fB-fpic, -fPIC, -fpie, -fPIE"
+Add defines for PIC/PIE code.
.IP "\fB-I <directory>"
Add <directory> to the #include search list.
.IP \fB-I-
Unset system or site specific include directories.
.IP "\fB-include <file>"
Include the <file> prior to the main input file.
+.IP "\fB-isystem <dir>"
+Look for include files in DIR, if not found in -I's.
+.IP "\fB-iquote <dir>"
+Look for #include "file" (with quotes) in DIR.
.IP \fB-j
Do not output the source line in diagnostics.
+.IP \fB-k
+Keep white spaces of input lines as they are.
.IP "\fB-M, -MM, -MD, -MMD, -MP, -MQ target, -MT target, -MF file"
Output source file dependency line for makefile.
+.IP \fB-m32
+Change target CPU from x86_64, ppc64 to i386, ppc, respectively.
+.IP \fB-m64
+Change target CPU from i386, ppc to x86_64, ppc64, respectively.
+.IP \fB-[no-]mmx
+(Un-)define __MMX__.
.IP \fB-N
Don't predefine any non-standard macros.
.IP \fB-nostdinc
@@ -83,8 +107,12 @@ Enable digraphs.
Re-define the pre-defined macro __STDC_HOSTED__ as <n>.
.IP \fB-lang-c89
Same as -S1.
+.IP "\fB-lang-c99, -lang-c9x"
+Same as -S199901L.
.IP \fB-lang-c++
Same as -+.
+.IP \fB-lang-asm
+Same as -a.
.IP "\fB-pedantic, -pedantic-errors"
Same as -W7.
.IP "\fB-S <n>"
diff -up ./src/system.c~ ./src/system.c
--- ./src/system.c~ 2013-06-20 16:06:01.365698424 +0200
+++ ./src/system.c 2013-06-20 18:50:23.996832143 +0200
@@ -1418,11 +1418,16 @@ static void usage(
"\nCommonly used options:\n",
+#if COMPILER == GNUC
+"-$ Forbid '$' in identifier.\n",
+"-fno-dollars-in-identifiers Likewise.\n",
+#endif
"-@MODE Specify preprocessing mode. MODE should be one of these 4:\n",
" -@std Standard conforming mode. (default)\n",
" -@poststd, -@post special 'post-Standard' mode.\n",
" -@kr K&R 1st mode.\n",
" -@oldprep, -@old 'old_preprocessor' mode (i.e. 'Reiser model' cpp).\n",
+" -@compat Standard 'compatible' mode.\n",
#if COMPILER == MSC
"-arch:SSE, -arch:SSE2 Define the macro _M_IX86_FP as 1, 2 respectively.\n",
@@ -1438,6 +1443,9 @@ static void usage(
"-C Output also comments.\n",
"-D <macro>[=<value>] Define <macro> as <value> (default:1).\n",
"-D <macro(args)>[=<replace>] Define <macro(args)> as <replace>.\n",
+#if COMPILER == GNUC
+"-dM,-dD Dump all current macro definitions to output stream.\n",
+#endif
"-e <encoding> Change the default multi-byte character encoding to one of:\n",
" euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.\n",
@@ -1447,6 +1455,11 @@ static void usage(
#if COMPILER == GNUC
"-finput-charset=<encoding> Same as -e <encoding>.\n",
" (Don't insert spaces around '=').\n",
+"-f[no-]working-directory (Don't) emit #line marks with current\n",
+" working directory.\n",
+"-fstack-protector[-all] Add defines for GCC stack protector.\n",
+"-f[no-]exceptions (Don't) add define for exception support.\n",
+"-fpic,-fPIC,-fpie,-fPIE Add defines for PIC/PIE code.\n"
#endif
#if COMPILER == MSC
"-Fl <file> Include the <file> prior to the main input file.\n",
@@ -1461,6 +1474,8 @@ static void usage(
#if COMPILER == GNUC
"-isysroot <dir> Change root of system header directory to <dir>.\n",
"-include <file> Include the <file> prior to the main input file.\n",
+"-isystem <dir> Look for include files in DIR, if not found in -I's.\n",
+"-iquote <dir> Look for #include \"file\" (with quotes) in DIR.\n",
#else
"-I- Unset system or site specific include directories.\n",
#endif
@@ -1474,6 +1489,7 @@ static void usage(
#if SYS_FAMILY == SYS_UNIX
"-m32 Change target CPU from x86_64, ppc64 to i386, ppc, respectively.\n",
"-m64 Change target CPU from i386, ppc to x86_64, ppc64, respectively.\n",
+"-[no-]mmx (Un-)define __MMX__.\n",
#endif
"-N Don't predefine any non-standard macros.\n",
@@ -1536,7 +1552,10 @@ static void usage(
#if COMPILER == GNUC
"-lang-c89 Same as -S1.\n",
+"-lang-c99 Same as -S199901L.\n",
+"-lang-c9x Likewise.\n",
"-lang-c++ Same as -+.\n",
+"-lang-asm Same as -a.\n",
"-pedantic, -pedantic-errors Same as -W7.\n",
"-S <n> Redefine __STDC__ to <n>.\n",
#else

17
mcpp-manual.html.patch Normal file
View File

@ -0,0 +1,17 @@
*** doc-jp/mcpp-manual.html 2007-04-02 00:20:16.000000000 +0900
--- doc-jp/mcpp-manual.html.utf8 2007-04-24 18:12:39.000000000 +0900
***************
*** 1,6 ****
<html>
<head>
! <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<style> pre {color: navy} tt {color: maroon} </style>
<style> table {border-collapse: separate; border-spacing: 0px; empty-cells: show; background-color: #f0f0ff} </style>
<style> th, td {text-align: left; padding-left: 15px; padding-right: 15px} </style>
--- 1,6 ----
<html>
<head>
! <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style> pre {color: navy} tt {color: maroon} </style>
<style> table {border-collapse: separate; border-spacing: 0px; empty-cells: show; background-color: #f0f0ff} </style>
<style> th, td {text-align: left; padding-left: 15px; padding-right: 15px} </style>

202
mcpp.spec Normal file
View File

@ -0,0 +1,202 @@
# spec file for mcpp / compiler-independent-library-build on fedora
Summary: Alternative C/C++ preprocessor
Name: mcpp
Version: 2.7.2
Release: 20%{?dist}
License: BSD
Group: Development/Languages
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
URL: http://mcpp.sourceforge.net/
Patch0: mcpp-manual.html.patch
# Extracted from http://www.zeroc.com/download/Ice/3.4/ThirdParty-Sources-3.4.2.tar.gz
Patch1: patch.mcpp.2.7.2
# https://bugzilla.redhat.com/show_bug.cgi?id=948860
Patch2: mcpp-man.patch
%description
C/C++ preprocessor defines and expands macros and processes '#if',
'#include' and some other directives.
MCPP is an alternative C/C++ preprocessor with the highest conformance.
It supports multiple standards: K&R, ISO C90, ISO C99, and ISO C++98.
MCPP is especially useful for debugging a source program which uses
complicated macros and also useful for checking portability of a source.
Though mcpp could be built as a replacement of GCC's resident
preprocessor or as a stand-alone program without using library build of
mcpp, this package installs only a program named 'mcpp' which links
shared library of mcpp and behaves independent from GCC.
%prep
%setup -q
%patch0 -p0 -b -z.euc-jp
%patch1 -p1
%patch2 -p1
%build
%configure --enable-mcpplib --disable-static
make CFLAGS="%{optflags}"
mv mcpp-gcc.1 mcpp.1
%install
iconv -f euc-jp -t utf-8 doc-jp/mcpp-manual.html > doc-jp/mcpp-manual-jp.html
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
rm -f $RPM_BUILD_ROOT%{_libdir}/libmcpp.la
%files
%defattr(-,root,root,-)
%doc ChangeLog ChangeLog.old NEWS README
%{_datadir}/man/man1/%{name}.1.gz
%{_bindir}/%{name}
%package -n libmcpp
Summary: Alternative C/C++ preprocessor (library build)
Group: Development/Languages
%description -n libmcpp
This package provides a library build of mcpp.
%files -n libmcpp
%defattr(-,root,root,-)
%doc LICENSE
%{_libdir}/libmcpp.so.*
%post -n libmcpp -p /sbin/ldconfig
%postun -n libmcpp -p /sbin/ldconfig
%package -n libmcpp-devel
Summary: Alternative C/C++ preprocessor (development package for library build)
Group: Development/Languages
Requires: libmcpp = %{version}
%description -n libmcpp-devel
Development package for libmcpp.
%files -n libmcpp-devel
%defattr(-,root,root,-)
%{_libdir}/libmcpp.so
%{_includedir}/mcpp_lib.h
%{_includedir}/mcpp_out.h
%package doc
Summary: Alternative C/C++ preprocessor (manual for library build)
Group: Documentation
%description doc
This package provides an html manual for mcpp.
%files doc
%defattr(-,root,root,-)
%doc LICENSE doc/mcpp-manual.html
%lang(ja) %doc doc-jp/mcpp-manual-jp.html
%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 2.7.2-14
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Jun 20 2013 Petr Machata <pmachata@redhat.com> - 2.7.2-10
- Update usage output and man pages to include some omited options.
(mcpp-man.patch)
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Fri Dec 16 2011 Mary Ellen Foster <mefoster at gmail.com> - 2.7.2-6
- Update upstream Ice patch to latest version
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Jul 21 2010 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.7.2-4
- Make subpackages to include LICENSE.
* Tue Oct 13 2009 Mary Ellen Foster <mefoster at gmail.com>
- Incorporate patch from Ice upstream project
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Dec 01 2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.7.2-1
- Upstream new release.
* Tue May 20 2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.7.1-1
- Upstream new release.
- Change to library build.
- Devide to 4 packages: mcpp, libmcpp, libmcpp-devel and mcpp-doc.
- Thanks to Mary Ellen Foster for correcting this spec file.
* Sun Mar 24 2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.7-2
- Upstream new release.
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.6.4-2
- Rebuild for selinux ppc32 issue.
* Thu May 19 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.4-1
- Upstream new release.
* Fri Apr 27 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.3-5
- Apply the new patch (patch1) for mcpp.
* Wed Apr 25 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.3-4
- Change installation of doc/mcpp-manual.html and doc-jp/mcpp-manual.html.
* Tue Apr 24 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.3-3
- Revise many points to adapt to the guideline of Fedora (thanks to
the review by Mamoru Tasaka):
use %%dist, %%configure, %%optflags, %%{_datadir}, %%lang(ja),
convert encoding of mcpp-manual.html to utf-8,
and others.
* Sat Apr 21 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.3-2
- Replace some variables with macros.
- Rename this spec file.
* Sat Apr 07 2007 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> 2.6.3-1
- First release for V.2.6.3 on sourceforge.

208
patch.mcpp.2.7.2 Normal file
View File

@ -0,0 +1,208 @@
diff -r -c -N ../mcpp-2.7.2-old/noconfig/vc2010.dif ./noconfig/vc2010.dif
*** ../mcpp-2.7.2-old/noconfig/vc2010.dif Wed Dec 31 20:30:00 1969
--- ./noconfig/vc2010.dif Fri May 14 12:47:22 2010
***************
*** 0 ****
--- 1,67 ----
+ *** noconfig.H Thu Sep 25 15:34:56 2008
+ --- noconfig.H.vc2005 Thu Sep 25 17:23:49 2008
+ ***************
+ *** 15,21 ****
+ */
+
+ /* Define target operating-system. */
+ ! #define SYSTEM SYS_FREEBSD
+
+ /* Define target compiler. */
+ #ifndef COMPILER
+ --- 15,21 ----
+ */
+
+ /* Define target operating-system. */
+ ! #define SYSTEM SYS_WIN32
+
+ /* Define target compiler. */
+ #ifndef COMPILER
+ ***************
+ *** 26,36 ****
+ #define HOST_SYSTEM SYSTEM
+
+ /* Define host compiler. */
+ ! #define HOST_COMPILER GNUC
+
+ /* Version message. */
+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
+ ! #define VERSION_MSG "GCC 3.4"
+ #if 0
+ "LCC-Win32 2006-03"
+ "Visual C 2005"
+ --- 26,36 ----
+ #define HOST_SYSTEM SYSTEM
+
+ /* Define host compiler. */
+ ! #define HOST_COMPILER MSC
+
+ /* Version message. */
+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
+ ! #define VERSION_MSG "Visual C 2010"
+ #if 0
+ "LCC-Win32 2006-03"
+ "Visual C 2005"
+ ***************
+ *** 212,221 ****
+ #define ONE_PASS TRUE
+ #endif
+ #define COMPILER_EXT "_MSC_VER"
+ ! #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */
+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
+ #define COMPILER_EXT2 "_MSC_FULL_VER"
+ ! #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */
+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
+ /* VC 2008: "150021022" */
+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
+ --- 212,221 ----
+ #define ONE_PASS TRUE
+ #endif
+ #define COMPILER_EXT "_MSC_VER"
+ ! #define COMPILER_EXT_VAL "1600" /* VC 6.0: "1200" */
+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
+ #define COMPILER_EXT2 "_MSC_FULL_VER"
+ ! #define COMPILER_EXT2_VAL "160030319" /* VC 6.0: "12008804" */
+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
+ /* VC 2008: "150021022" */
+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
diff -r -c -N ../mcpp-2.7.2-old/src/internal.H ./src/internal.H
*** ../mcpp-2.7.2-old/src/internal.H Wed Aug 27 10:31:16 2008
--- ./src/internal.H Fri May 14 12:40:56 2010
***************
*** 390,395 ****
--- 390,397 ----
extern char identifier[]; /* Lastly scanned name */
extern IFINFO ifstack[]; /* Information of #if nesting */
extern char work_buf[];
+ extern FILEINFO * sh_file;
+ extern int sh_line;
/* Temporary buffer for directive line and macro expansion */
/* main.c */
***************
*** 557,562 ****
#endif
#endif
! #if HOST_HAVE_STPCPY
extern char * stpcpy( char * dest, const char * src);
#endif
--- 559,564 ----
#endif
#endif
! #if HOST_HAVE_STPCPY && !defined(stpcpy)
extern char * stpcpy( char * dest, const char * src);
#endif
diff -r -c -N ../mcpp-2.7.2-old/src/main.c ./src/main.c
*** ../mcpp-2.7.2-old/src/main.c Wed Nov 5 05:04:46 2008
--- ./src/main.c Fri May 14 12:40:56 2010
***************
*** 326,331 ****
--- 326,333 ----
= FALSE;
option_flags.trig = TRIGRAPHS_INIT;
option_flags.dig = DIGRAPHS_INIT;
+ sh_file = NULL;
+ sh_line = 0;
}
int mcpp_lib_main
diff -r -c -N ../mcpp-2.7.2-old/src/support.c ./src/support.c
*** ../mcpp-2.7.2-old/src/support.c Tue Jun 10 06:02:33 2008
--- ./src/support.c Fri May 14 12:40:56 2010
***************
*** 188,194 ****
size_t length
)
{
! if (mem_buf_p->bytes_avail < length) { /* Need to allocate more memory */
size_t size = MAX( BUF_INCR_SIZE, length);
if (mem_buf_p->buffer == NULL) { /* 1st append */
--- 188,194 ----
size_t length
)
{
! if (mem_buf_p->bytes_avail < length + 1) { /* Need to allocate more memory */
size_t size = MAX( BUF_INCR_SIZE, length);
if (mem_buf_p->buffer == NULL) { /* 1st append */
***************
*** 1722,1727 ****
--- 1722,1729 ----
sp -= 2;
while (*sp != '\n') /* Until end of line */
mcpp_fputc( *sp++, OUT);
+ mcpp_fputc( '\n', OUT);
+ wrong_line = TRUE;
}
goto end_line;
default: /* Not a comment */
diff -r -c -N ../mcpp-2.7.2-old/src/system.c ./src/system.c
*** ../mcpp-2.7.2-old/src/system.c 2008-11-26 10:53:51.000000000 +0100
--- ./src/system.c 2011-02-21 16:18:05.678058106 +0100
***************
*** 3534,3539 ****
--- 3534,3565 ----
FILEINFO * file;
const char * too_many_include_nest =
"More than %.0s%ld nesting of #include"; /* _F_ _W4_ */
+
+ //
+ // When encoding is UTF-8, skip BOM if present.
+ //
+ if(mbchar == UTF8 && fp != NULL && ftell(fp) == 0)
+ {
+ const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF};
+ unsigned char FILE_HEAD[3] = {0, 0, 0};
+ int i;
+ for(i = 0; i < 3; ++i)
+ {
+ FILE_HEAD[i] = getc(fp);
+ if(FILE_HEAD[i] != UTF8_BOM[i])
+ {
+ if(FILE_HEAD[i] == (unsigned char)EOF)
+ {
+ i--;
+ }
+ for(; i >= 0; --i)
+ {
+ ungetc(FILE_HEAD[i], fp);
+ }
+ break;
+ }
+ }
+ }
filename = set_fname( filename); /* Search or append to fnamelist[] */
fullname = set_fname( fullname); /* Search or append to fnamelist[] */
***************
*** 3858,3863 ****
--- 3884,3892 ----
}
#endif
+ FILEINFO* sh_file;
+ int sh_line;
+
void sharp(
FILEINFO * sharp_file,
int flag /* Flag to append to the line for GCC */
***************
*** 3868,3875 ****
* else (i.e. 'sharp_file' is NULL) 'infile'.
*/
{
- static FILEINFO * sh_file;
- static int sh_line;
FILEINFO * file;
int line;
--- 3897,3902 ----

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (mcpp-2.7.2.tar.gz) = 1ca885cb13fdb684de9d0595a9215b52f48a93a69077d82cdcacafe40d9a61fb77b00a3ff2b8890e7bc0a0fcc0c8d70d4093c00c280351cd4459aba67c573235