diff --git a/src/cpp.c b/src/cpp.c index 871fc3482e62c2320498291e8d8e624a9b06f12f..89ec7d77dd88cd63e48c0052af29eacc731aa4c3 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.85 2001/05/29 16:48:20 grubba Exp $ + * $Id: cpp.c,v 1.86 2001/05/29 17:17:48 grubba Exp $ */ #include "global.h" #include "stralloc.h" @@ -84,7 +84,7 @@ struct define magic_define_fun magic; int args; ptrdiff_t num_parts; - short inside; + short inside; /* 1 - Don't expand. 2 - In use. */ short varargs; struct pike_string *first; struct define_part parts[1]; diff --git a/src/preprocessor.h b/src/preprocessor.h index 00e688d90389a1c3ecf8dea83aa48d08c1456994..34e2a79d0f77f9738c1f946eb580c3c3e204a885 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -1,5 +1,5 @@ /* - * $Id: preprocessor.h,v 1.40 2001/05/29 16:48:21 grubba Exp $ + * $Id: preprocessor.h,v 1.41 2001/05/29 17:17:48 grubba Exp $ * * Preprocessor template. * Based on cpp.c 1.45 @@ -877,12 +877,13 @@ static ptrdiff_t lower_cpp(struct cpp *this, } } - if(d && !d->inside) + if(d && !(d->inside & 1)) { int arg=0; INT32 startline = this->current_line; struct string_builder tmp; struct define_argument arguments [MAX_ARGS]; + short inside = d->inside; if(s) add_ref(s); @@ -1033,11 +1034,11 @@ static ptrdiff_t lower_cpp(struct cpp *this, INT32 line=this->current_line; save=this->buf; this->buf=tmp; - d->inside = 1; + d->inside = 2; lower_cpp(this, a, l, flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE), auto_convert, charset); - d->inside = 0; + d->inside = inside; tmp=this->buf; this->buf=save; this->current_line=line; @@ -1074,7 +1075,7 @@ static ptrdiff_t lower_cpp(struct cpp *this, if(s) { if((d=find_define(s))) - d->inside=0; + d->inside = inside; free_string(s); }