pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:2250:    *! // Strip debug    *! #define werror(X ...) 0    *! #include "/home/someone/experimental/stuff.h"    *! #undef werror    *!    *! @seealso    *! @[#define], @[defined()]    */   static void undefine(struct CPP_struct *this, struct pike_string *name)   { +  if (!this->defines) return;    ref_push_string(name);    push_int(0);    map_delete_no_free(this->defines, Pike_sp - 2, Pike_sp - 1);       if (TYPEOF(Pike_sp[-1]) == PIKE_T_OBJECT) {    struct object *o = Pike_sp[-1].u.object;    struct define_struct *def = (struct define_struct *)get_storage(o, define_program);    if (def->flags & (CPP_MACRO_IN_USE | CPP_MACRO_DISABLED)) {    /* Restore the #define. */    mapping_insert(this->defines, Pike_sp - 2, Pike_sp - 1);
pike.git/src/cpp.cmod:2318:    return make_shared_string(name);   }      static struct define_struct *add_define(struct CPP_struct *this,    struct pike_string *name,    struct svalue *what)   {    struct pike_string *orig_name = name;    struct define_struct *def;    +  if (!this->defines) { +  this->defines = allocate_mapping(32); +  } +     if( (name->len > 2) &&    (index_shared_string(name, name->len-1) == ')') &&    (index_shared_string(name, name->len-2) == '(')) {    /* Function-style macro. */    push_string(name = string_slice(name, 0, name->len-2));    }       /* NB: alloc_empty_define() pushes the define object onto the stack.    */    def = alloc_empty_define(name);
pike.git/src/cpp.cmod:3555:    PCHARP data,    ptrdiff_t len,    int flags,    struct pike_string *charset)   {    ptrdiff_t pos, tmp, e;    int include_mode;    INT_TYPE first_line = this->current_line;    /* FIXME: What about this->current_file? */    +  if (!this->defines) { +  this->defines = allocate_mapping(32); +  } +     for(pos=0; pos<len;)    {    ptrdiff_t old_pos = pos;    int c;   /* fprintf(stderr,"%c",DATA(pos));    fflush(stderr); */       switch(c = DATA(pos++))    {    case '\n':