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