blob: 36cc2bd64df422f93eb0227d72eb1c7394674f70 [file] [log] [blame]
Patrick Williams520786c2023-06-25 16:20:36 -05001Upstream-Status: Pending
2
Patrick Williamsb48b7b42016-08-17 15:04:38 -05003diff -r -c -N ../mcpp-2.7.2-old/noconfig/vc2010.dif ./noconfig/vc2010.dif
4*** ../mcpp-2.7.2-old/noconfig/vc2010.dif Wed Dec 31 20:30:00 1969
5--- ./noconfig/vc2010.dif Fri May 14 12:47:22 2010
6***************
7*** 0 ****
8--- 1,67 ----
9+ *** noconfig.H Thu Sep 25 15:34:56 2008
10+ --- noconfig.H.vc2005 Thu Sep 25 17:23:49 2008
11+ ***************
12+ *** 15,21 ****
13+ */
14+
15+ /* Define target operating-system. */
16+ ! #define SYSTEM SYS_FREEBSD
17+
18+ /* Define target compiler. */
19+ #ifndef COMPILER
20+ --- 15,21 ----
21+ */
22+
23+ /* Define target operating-system. */
24+ ! #define SYSTEM SYS_WIN32
25+
26+ /* Define target compiler. */
27+ #ifndef COMPILER
28+ ***************
29+ *** 26,36 ****
30+ #define HOST_SYSTEM SYSTEM
31+
32+ /* Define host compiler. */
33+ ! #define HOST_COMPILER GNUC
34+
35+ /* Version message. */
36+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
37+ ! #define VERSION_MSG "GCC 3.4"
38+ #if 0
39+ "LCC-Win32 2006-03"
40+ "Visual C 2005"
41+ --- 26,36 ----
42+ #define HOST_SYSTEM SYSTEM
43+
44+ /* Define host compiler. */
45+ ! #define HOST_COMPILER MSC
46+
47+ /* Version message. */
48+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
49+ ! #define VERSION_MSG "Visual C 2010"
50+ #if 0
51+ "LCC-Win32 2006-03"
52+ "Visual C 2005"
53+ ***************
54+ *** 212,221 ****
55+ #define ONE_PASS TRUE
56+ #endif
57+ #define COMPILER_EXT "_MSC_VER"
58+ ! #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */
59+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
60+ #define COMPILER_EXT2 "_MSC_FULL_VER"
61+ ! #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */
62+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
63+ /* VC 2008: "150021022" */
64+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
65+ --- 212,221 ----
66+ #define ONE_PASS TRUE
67+ #endif
68+ #define COMPILER_EXT "_MSC_VER"
69+ ! #define COMPILER_EXT_VAL "1600" /* VC 6.0: "1200" */
70+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
71+ #define COMPILER_EXT2 "_MSC_FULL_VER"
72+ ! #define COMPILER_EXT2_VAL "160030319" /* VC 6.0: "12008804" */
73+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
74+ /* VC 2008: "150021022" */
75+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
76diff -r -c -N ../mcpp-2.7.2-old/src/internal.H ./src/internal.H
77*** ../mcpp-2.7.2-old/src/internal.H Wed Aug 27 10:31:16 2008
78--- ./src/internal.H Fri May 14 12:40:56 2010
79***************
80*** 390,395 ****
81--- 390,397 ----
82 extern char identifier[]; /* Lastly scanned name */
83 extern IFINFO ifstack[]; /* Information of #if nesting */
84 extern char work_buf[];
85+ extern FILEINFO * sh_file;
86+ extern int sh_line;
87 /* Temporary buffer for directive line and macro expansion */
88
89 /* main.c */
90***************
91*** 557,562 ****
92 #endif
93 #endif
94
95! #if HOST_HAVE_STPCPY
96 extern char * stpcpy( char * dest, const char * src);
97 #endif
98--- 559,564 ----
99 #endif
100 #endif
101
102! #if HOST_HAVE_STPCPY && !defined(stpcpy)
103 extern char * stpcpy( char * dest, const char * src);
104 #endif
105diff -r -c -N ../mcpp-2.7.2-old/src/main.c ./src/main.c
106*** ../mcpp-2.7.2-old/src/main.c Wed Nov 5 05:04:46 2008
107--- ./src/main.c Fri May 14 12:40:56 2010
108***************
109*** 326,331 ****
110--- 326,333 ----
111 = FALSE;
112 option_flags.trig = TRIGRAPHS_INIT;
113 option_flags.dig = DIGRAPHS_INIT;
114+ sh_file = NULL;
115+ sh_line = 0;
116 }
117
118 int mcpp_lib_main
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500119diff -r -c -N ../mcpp-2.7.2-old/src/system.c ./src/system.c
120*** ../mcpp-2.7.2-old/src/system.c 2008-11-26 10:53:51.000000000 +0100
121--- ./src/system.c 2011-02-21 16:18:05.678058106 +0100
122***************
123*** 3534,3539 ****
124--- 3534,3565 ----
125 FILEINFO * file;
126 const char * too_many_include_nest =
127 "More than %.0s%ld nesting of #include"; /* _F_ _W4_ */
128+
129+ //
130+ // When encoding is UTF-8, skip BOM if present.
131+ //
132+ if(mbchar == UTF8 && fp != NULL && ftell(fp) == 0)
133+ {
134+ const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF};
135+ unsigned char FILE_HEAD[3] = {0, 0, 0};
136+ int i;
137+ for(i = 0; i < 3; ++i)
138+ {
139+ FILE_HEAD[i] = getc(fp);
140+ if(FILE_HEAD[i] != UTF8_BOM[i])
141+ {
142+ if(FILE_HEAD[i] == (unsigned char)EOF)
143+ {
144+ i--;
145+ }
146+ for(; i >= 0; --i)
147+ {
148+ ungetc(FILE_HEAD[i], fp);
149+ }
150+ break;
151+ }
152+ }
153+ }
154
155 filename = set_fname( filename); /* Search or append to fnamelist[] */
156 fullname = set_fname( fullname); /* Search or append to fnamelist[] */
157***************
158*** 3858,3863 ****
159--- 3884,3892 ----
160 }
161 #endif
162
163+ FILEINFO* sh_file;
164+ int sh_line;
165+
166 void sharp(
167 FILEINFO * sharp_file,
168 int flag /* Flag to append to the line for GCC */
169***************
170*** 3868,3875 ****
171 * else (i.e. 'sharp_file' is NULL) 'infile'.
172 */
173 {
174- static FILEINFO * sh_file;
175- static int sh_line;
176 FILEINFO * file;
177 int line;
178
179--- 3897,3902 ----