fix cpp + defined variable name
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6570 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d83ec6779b
commit
2fe4996068
1 changed files with 4 additions and 4 deletions
|
|
@ -1096,9 +1096,7 @@ Preprocessor_parse(String *s)
|
|||
case 0: /* Initial state - in first column */
|
||||
/* Look for C preprocessor directives. Otherwise, go directly to state 1 */
|
||||
if (c == '#') {
|
||||
replace_defined = 1;
|
||||
add_chunk(ns,chunk,allow);
|
||||
replace_defined = 0;
|
||||
copy_location(s,chunk);
|
||||
cpp_lines = 1;
|
||||
state = 40;
|
||||
|
|
@ -1337,6 +1335,7 @@ Preprocessor_parse(String *s)
|
|||
}
|
||||
}
|
||||
} else if (Cmp(id,"if") == 0) {
|
||||
replace_defined = 1;
|
||||
cond_lines[level] = Getline(id);
|
||||
level++;
|
||||
if (allow) {
|
||||
|
|
@ -1358,7 +1357,9 @@ Preprocessor_parse(String *s)
|
|||
}
|
||||
mask = 1;
|
||||
}
|
||||
replace_defined = 0;
|
||||
} else if (Cmp(id,"elif") == 0) {
|
||||
replace_defined = 1;
|
||||
if (level == 0) {
|
||||
Swig_error(Getfile(s),Getline(id),"Misplaced #elif.\n");
|
||||
} else {
|
||||
|
|
@ -1385,6 +1386,7 @@ Preprocessor_parse(String *s)
|
|||
}
|
||||
}
|
||||
}
|
||||
replace_defined = 0;
|
||||
} else if (Cmp(id,"line") == 0) {
|
||||
} else if (Cmp(id,"include") == 0) {
|
||||
if (((include_all) || (import_all)) && (allow)) {
|
||||
|
|
@ -1457,9 +1459,7 @@ Preprocessor_parse(String *s)
|
|||
}
|
||||
/* %#cpp - an embedded C preprocessor directive (we strip off the %) */
|
||||
else if (c == '#') {
|
||||
replace_defined = 1;
|
||||
add_chunk(ns,chunk,allow);
|
||||
replace_defined = 0;
|
||||
Putc(c,chunk);
|
||||
state = 107;
|
||||
} else if (isidentifier(c)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue