pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:528:    }    if (raw_arg & DEF_ARG_NOPOSTSPACE) {    while(len && wide_isspace(INDEX_PCHARP(a, len-1))) {    len--;    }    }    string_builder_append(&s, a, len);    } else {    /* NB: Evaluate the argument before insertion. */    int save_flags = d->flags; -  d->flags = CPP_MACRO_IN_USE; +  d->flags |= CPP_MACRO_IN_USE;       ref_push_string(str);    push_int(flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE));    safe_apply(context_obj, "cpp", 2);    string_builder_shared_strcat(&s, Pike_sp[-1].u.string);    pop_stack();       d->flags = save_flags;       }
pike.git/src/cpp.cmod:3398:    * means that Pike_fp->current_object is an object(CPP).    */   static void apply_define(struct CPP_struct *this,    struct define_struct *d,    struct define_argument *arguments,    short flags,    struct pike_string *charset)   {   #if 1    struct svalue *save_sp = Pike_sp; +  int save_flags;       /* Keep d around... */    push_svalue(&d->self);       if (d->args < 0) {    push_undefined();    } else {    int i;    BEGIN_AGGREGATE_ARRAY(d->args) {    for (i = 0; i < d->args; i++) {    push_string(make_shared_binary_pcharp(arguments[i].arg,    arguments[i].len));    DO_AGGREGATE_ARRAY(120);    }    } END_AGGREGATE_ARRAY;    }    ref_push_object(Pike_fp->current_object);    push_int(flags);    apply_lfun(d->self.u.object, LFUN_CALL, 3);    -  d->flags = CPP_MACRO_DISABLED; +  save_flags = d->flags; +  d->flags |= CPP_MACRO_DISABLED;       /* NB: We're executing in the CPP context object. */    low_cpp(this, MKPCHARP_STR(Pike_sp[-1].u.string), Pike_sp[-1].u.string->len,    flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE),    charset);    -  d->flags = flags; +  d->flags = save_flags;       pop_n_elems(Pike_sp - save_sp);   #else /* !1 */    struct string_builder tmp;       init_string_builder(&tmp, 0);    if(d->magic)    {    int i;    struct pike_string *a = NULL;
pike.git/src/cpp.cmod:3493:    while(l && wide_isspace(EXTRACT_PCHARP(a)))    INC_PCHARP(a,1),l--;       while(l && wide_isspace(INDEX_PCHARP(a,l-1)))    l--;       if(argument & (DEF_ARG_NOPRESPACE | DEF_ARG_NOPOSTSPACE))    {    string_builder_append( &tmp, a, l );    }else{ +  /* NB: Evaluate the argument before insertion. */    struct string_builder save;    INT_TYPE line = this->current_line; -  +  int save_flags;    /* FIXME: Shouldn't we save current_file too? */    save=this->buf;    this->buf=tmp; -  d->flags = CPP_MACRO_IN_USE; +  save_flags = d->flags; +  d->flags |= CPP_MACRO_IN_USE;    low_cpp(this, a, l,    flags & ~(CPP_EXPECT_ENDIF | CPP_EXPECT_ELSE),    charset); -  d->flags = flags; +  d->flags = save_flags;    tmp=this->buf;    this->buf=save;    this->current_line=line;    }    }       if(!(argument & DEF_ARG_NOPOSTSPACE))    string_builder_putchar(&tmp, ' ');    }    break;