Fix use of preprocessor null directive
This was broken recently in commit 255c929c56
for issue #217
This commit is contained in:
parent
68a936a638
commit
93d58cd3ed
3 changed files with 21 additions and 0 deletions
|
|
@ -346,3 +346,20 @@ int method(struct TypeNameTraits tnt) {
|
|||
return tnt.val;
|
||||
}
|
||||
%}
|
||||
|
||||
/* Null directive */
|
||||
# /* comment 1 */
|
||||
# // comment 2
|
||||
# /** comment 3 */
|
||||
# /* comment 4 */ /*comment 5*/
|
||||
# /** comment 6
|
||||
#
|
||||
# more comment 6 */
|
||||
#
|
||||
#
|
||||
#
|
||||
int methodX(int x);
|
||||
%{
|
||||
int methodX(int x) { return x+100; }
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,3 +12,5 @@ if preproc.defined != 1:
|
|||
if 2*preproc.one != preproc.two:
|
||||
raise RuntimeError
|
||||
|
||||
if preproc.methodX(99) != 199:
|
||||
raise RuntimeError
|
||||
|
|
|
|||
|
|
@ -1768,6 +1768,8 @@ String *Preprocessor_parse(String *s) {
|
|||
}
|
||||
} else if (Equal(id, kpp_level)) {
|
||||
Swig_error(Getfile(s), Getline(id), "cpp debug: level = %d, startlevel = %d\n", level, start_level);
|
||||
} else if (Equal(id, "")) {
|
||||
/* Null directive */
|
||||
} else {
|
||||
Swig_error(Getfile(s), Getline(id), "Unknown SWIG preprocessor directive: %s\n", id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue