From 80a13e97dba94e8cb26ef5515074cf0d21392f0d Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Wed, 2 Feb 2000 04:26:52 +0000 Subject: [PATCH] Fixed problem with preprocessor directives embedded inside an %inline directive. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@174 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/SWIG1.1/parser.yxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SWIG/Source/SWIG1.1/parser.yxx b/SWIG/Source/SWIG1.1/parser.yxx index 982c4f5cb..3c99cb730 100644 --- a/SWIG/Source/SWIG1.1/parser.yxx +++ b/SWIG/Source/SWIG1.1/parser.yxx @@ -53,6 +53,7 @@ extern void format_string(char *); extern void swig_pragma(char *, char *); #include "internal.h" +#include "preprocessor.h" #ifdef NEED_ALLOC void *alloca(unsigned n) { @@ -1054,7 +1055,17 @@ statement : INCLUDE STRING LBRACE { init_language(); $2[strlen($2) - 1] = 0; fprintf(f_header, "%s\n", $2); - start_inline($2,start_line); + { + /* Need to run through the preprocessor */ + DOH *cpps; + DOH *s = NewString($2); + Setline(s,start_line); + Setfile(s,input_file); + cpps = Preprocessor_parse(s); + start_inline(Char(cpps), start_line); + Delete(s); + Delete(cpps); + } } }