aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/mcpp/mcpp-2.7.2/slice2ccp-no-crash.patch
blob: 1a0d9314733897fc95108bb659bfdc35b92df8b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Index: mcpp-2.7.2/src/internal.H
===================================================================
--- mcpp-2.7.2.orig/src/internal.H	2010-12-12 15:52:09.556466001 +0100
+++ mcpp-2.7.2/src/internal.H	2010-12-12 15:52:28.313840001 +0100
@@ -390,6 +390,8 @@
 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   */
Index: mcpp-2.7.2/src/main.c
===================================================================
--- mcpp-2.7.2.orig/src/main.c	2010-12-12 15:52:16.115744002 +0100
+++ mcpp-2.7.2/src/main.c	2010-12-12 15:52:28.317842001 +0100
@@ -326,6 +326,8 @@
             = FALSE;
     option_flags.trig = TRIGRAPHS_INIT;
     option_flags.dig = DIGRAPHS_INIT;
+    sh_file = NULL;
+    sh_line = 0;
 }
 
 int     mcpp_lib_main
Index: mcpp-2.7.2/src/system.c
===================================================================
--- mcpp-2.7.2.orig/src/system.c	2010-12-12 15:52:22.939154002 +0100
+++ mcpp-2.7.2/src/system.c	2010-12-12 15:52:28.317842001 +0100
@@ -3858,6 +3858,9 @@
 }
 #endif
 
+FILEINFO*       sh_file;
+int             sh_line;
+
 void    sharp(
     FILEINFO *  sharp_file,
     int         flag        /* Flag to append to the line for GCC   */
@@ -3868,8 +3871,6 @@
  * else (i.e. 'sharp_file' is NULL) 'infile'.
  */
 {
-    static FILEINFO *   sh_file;
-    static int  sh_line;
     FILEINFO *  file;
     int         line;