pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:79:   };      static int use_initial_predefs;   static struct pike_predef_s *first_predef = NULL, *last_predef = NULL;      struct define_argument {    PCHARP arg;    ptrdiff_t len;   };    - struct cpp; + struct CPP_struct;   struct define_struct; - typedef void (*magic_define_fun)(struct cpp *, + typedef void (*magic_define_fun)(struct CPP_struct *,    struct define_struct *,    struct pike_string *,    struct string_builder *);      DECLARATIONS;      #define CPP_MACRO_DISABLED 1 /* Don't expand. */   #define CPP_MACRO_IN_USE 2 /* In use. */      PIKECLASS define
pike.git/src/cpp.cmod:114:    struct define_struct *def = (struct define_struct *)CURRENT_STORAGE;    def->args=-1;   #ifdef PIKE_NULL_IS_SPECIAL    def->magic=0;    def->flags = 0;    def->varargs=0;   #endif    }   }    - struct cpp + PIKECLASS CPP   { -  struct mapping *defines; -  INT_TYPE current_line; -  INT32 compile_errors; -  struct pike_string *current_file; -  struct string_builder buf; -  struct object *handler; -  struct object *compat_handler; -  INT_TYPE compat_major; -  INT_TYPE compat_minor; -  struct pike_string *data; -  struct pike_string *prefix; -  INT_TYPE picky_cpp, keep_comments, dependencies_fail; +  PIKEVAR mapping(string:object(define)) defines flags ID_PRIVATE|ID_PROTECTED; +  PIKEVAR int current_line; +  PIKEVAR int compile_errors; +  PIKEVAR string current_file; +  CVAR struct string_builder buf; +  PIKEVAR object handler; +  PIKEVAR object compat_handler; +  PIKEVAR int compat_major; +  PIKEVAR int compat_minor; +  /* NB: data is marked private to ensure that pike level code can't +  * remove its references while we hold pointers into it. +  */ +  PIKEVAR string data flags ID_PRIVATE|ID_PROTECTED; +  PIKEVAR string prefix; +  PIKEVAR int picky_cpp; +  PIKEVAR int keep_comments; +  PIKEVAR int dependencies_fail; +  +  INIT +  { +  init_string_builder(&THIS->buf, 0); +  } +  +  EXIT +  { +  /* NOTE: Most of the fields are mapped, and thus freed automatically. */ +  +  if (THIS->buf.s) { +  free_string_builder(&THIS->buf); +  } +  }   };      #define FIND_DEFINE(N) find_define(this, (N))    - static struct define_struct *find_define(struct cpp *this, struct pike_string *n) + static struct define_struct *find_define(struct CPP_struct *this, struct pike_string *n)   {    struct svalue *s;    if (!this->defines) return NULL;    if (!(s = low_mapping_string_lookup(this->defines, n))) return NULL;    if (TYPEOF(*s) != T_OBJECT) return NULL;    return (struct define_struct *)get_storage(s->u.object, define_program);   }    - static void cpp_error(struct cpp *this, const char *err) ATTRIBUTE((noinline)); - static void cpp_error_vsprintf (struct cpp *this, const char *fmt, + static void cpp_error(struct CPP_struct *this, const char *err) ATTRIBUTE((noinline)); + static void cpp_error_vsprintf (struct CPP_struct *this, const char *fmt,    va_list args) ATTRIBUTE((noinline)); - static void cpp_error_sprintf(struct cpp *this, const char *fmt, ...) ATTRIBUTE((noinline)); - static void cpp_handle_exception(struct cpp *this, + static void cpp_error_sprintf(struct CPP_struct *this, const char *fmt, ...) ATTRIBUTE((noinline)); + static void cpp_handle_exception(struct CPP_struct *this,    const char *cpp_error_fmt, ...) ATTRIBUTE((noinline)); - static void cpp_warning(struct cpp *this, const char *cpp_warn_fmt, ...) ATTRIBUTE((noinline)); + static void cpp_warning(struct CPP_struct *this, const char *cpp_warn_fmt, ...) ATTRIBUTE((noinline));   struct define_struct *defined_macro = NULL;   static struct svalue defined_macro_sval;    - static void cpp_error(struct cpp *this, const char *err) + static void cpp_error(struct CPP_struct *this, const char *err)   {    this->compile_errors++;    if(this->compile_errors > 10) return;    if((this->handler && this->handler->prog) || get_master())    {    ref_push_string(this->current_file);    push_int(this->current_line);    push_text(err);    low_safe_apply_handler("compile_error", this->handler,    this->compat_handler, 3);    pop_stack();    }else{    (void)fprintf(stderr, "%s:%ld: %s\n",    this->current_file->str,    (long)this->current_line,    err);    fflush(stderr);    }   }    - static void cpp_error_vsprintf (struct cpp *this, const char *fmt, + static void cpp_error_vsprintf (struct CPP_struct *this, const char *fmt,    va_list args)   {    struct string_builder s;    struct pike_string *msg;       this->compile_errors++;    if (this->compile_errors > 10) return;       init_string_builder(&s, 0);   
pike.git/src/cpp.cmod:214:       if (!msg->size_shift) {    fprintf(stderr, "%s\n", msg->str);    } else {    fprintf(stderr, "WIDE (fmt: %s)\n", fmt);    }    free_string(msg);    fflush(stderr);   }    - static void cpp_error_sprintf(struct cpp *this, const char *fmt, ...) + static void cpp_error_sprintf(struct CPP_struct *this, const char *fmt, ...)   {    va_list args;    va_start(args,fmt);    cpp_error_vsprintf (this, fmt, args);    va_end(args);   }    - static void cpp_handle_exception(struct cpp *this, + static void cpp_handle_exception(struct CPP_struct *this,    const char *cpp_error_fmt, ...)   {    struct svalue thrown;    move_svalue (&thrown, &throw_value);    mark_free_svalue (&throw_value);       if (cpp_error_fmt) {    va_list args;    va_start (args, cpp_error_fmt);    cpp_error_vsprintf (this, cpp_error_fmt, args);
pike.git/src/cpp.cmod:252:    if (s) {    cpp_error_sprintf(this, "%S", s);    free_string (s);    }    }       pop_stack();    free_svalue(&thrown);   }    - static void cpp_warning(struct cpp *this, const char *cpp_warn_fmt, ...) + static void cpp_warning(struct CPP_struct *this, const char *cpp_warn_fmt, ...)   {    struct string_builder sb;    va_list args;       init_string_builder (&sb, 0);    va_start(args, cpp_warn_fmt);    string_builder_vsprintf (&sb, cpp_warn_fmt, args);    va_end(args);       if((this->handler && this->handler->prog) || get_master())
pike.git/src/cpp.cmod:483:      /*! @endclass    */      /*! @namespace predef:: */   /*! @decl import cpp:: */   /*! @endnamespace */      /* #pike handling. */    - void cpp_change_compat(struct cpp *this, int major, int minor) + void cpp_change_compat(struct CPP_struct *this, int major, int minor)   {    if(this->compat_major == major &&    this->compat_minor == minor) return;       if(this->compat_handler)    {    free_object(this->compat_handler);    this->compat_handler=0;    }    if((major == PIKE_MAJOR_VERSION &&
pike.git/src/cpp.cmod:889:    *! @[defined] returns true if the symbol given as argument    *! is defined.    *!    *! @note    *! @tt{#if defined(MY_DEF)@} is equvivalent to    *! @tt{#ifdef MY_DEF@}.    *!    *! @seealso    *! @[#if], @[#ifdef], @[constant()]    */ - static void check_defined(struct cpp *this, + static void check_defined(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *arg,    struct string_builder *tmp)   {    if(arg && FIND_DEFINE(arg))    string_builder_binary_strcat(tmp, " 1 ", 3);    else    string_builder_binary_strcat(tmp, " 0 ", 3);   }    - static int do_safe_index_call(struct cpp *this, struct pike_string *s) + static int do_safe_index_call(struct CPP_struct *this, struct pike_string *s)   {    int res;    JMP_BUF recovery;    if(!s) return 0;       if (SETJMP_SP(recovery, 1)) {    if(this->picky_cpp)    cpp_warning (this, "Error indexing module with %S.", s);    res = 0;    push_undefined();
pike.git/src/cpp.cmod:929:   }      /*! @decl int(0..1) constant(mixed identifier)    *! @decl __deprecated__ int(0..1) efun(mixed identifier)    *!    *! Check whether the argument resolves to a constant or not.    *!    *! @seealso    *! @[#if], @[defined()]    */ - static void cpp_constant(struct cpp *this, int value) + static void cpp_constant(struct CPP_struct *this, int value)   {    struct svalue *save_stack=Pike_sp;    struct array *arr;    INT_TYPE res = 0;    int n;       /* FIXME: Protection against errors. */    /* Remove extra whitespace. */    push_static_text(" ");    o_subtract();
pike.git/src/cpp.cmod:1060:    for (def = first_predef; def; def = def->next) {    struct pike_string *name = make_shared_string(def->name);    struct pike_string *value = make_shared_string(def->value);    mapping_string_insert_string(map, name, value);    free_string(value);    free_string(name);    }    return map;   }    - static p_wchar2 readchar( PCHARP data, ptrdiff_t *pos, struct cpp *this ) + static p_wchar2 readchar( PCHARP data, ptrdiff_t *pos, struct CPP_struct *this )   {    ptrdiff_t l;    p_wchar2 C;    INC_PCHARP(data,*pos);    switch(parse_esc_seq_pcharp (data, &C, &l))    {    case 0:    *pos += l;    break;    case 1:
pike.git/src/cpp.cmod:1101:    break;   #ifdef PIKE_DEBUG    case 2: Pike_fatal ("Not supposed to happen.\n");    default: Pike_fatal ("Unknown error from parse_esc_seq.\n");   #endif    }    return C;   }       - static ptrdiff_t readstring( struct cpp *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos, + static ptrdiff_t readstring( struct CPP_struct *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos,    struct string_builder*nf, int nl_ok)   {    while(1)    {    pos++;    if(pos>=len)    {    cpp_error(this,"End of file in string.");    break;    }
pike.git/src/cpp.cmod:1154:    default:    string_builder_putchar(nf, INDEX_PCHARP(data,pos));    continue;    }    pos++;    break;    }    return pos;   }    - static ptrdiff_t readstring_lit( struct cpp *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos, + static ptrdiff_t readstring_lit( struct CPP_struct *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos,    struct string_builder*nf, INT32 ec)   {    INT32 ch;    while(1) {    if(++pos>=len) {    cpp_error(this,"End of file in string.");    break;    }    if((ch=INDEX_PCHARP(data,pos)) == '#' && INDEX_PCHARP(data,pos+1)==ec)    return pos + 2;
pike.git/src/cpp.cmod:1176:    if (ch == '\n') {    this->current_line++;    PUTNL();    }    string_builder_putchar(nf, ch);    }    }    return pos;   }    - static ptrdiff_t fixstring(struct cpp *this, const PCHARP data, ptrdiff_t len, + static ptrdiff_t fixstring(struct CPP_struct *this, const PCHARP data, ptrdiff_t len,    ptrdiff_t pos, struct string_builder *nf, int outp)   {    int trailing_newlines=0;    if(outp) string_builder_putchar(nf, '"');    while(1)    {    if(pos>=len)    {    cpp_error(this,"End of file in string.");    break;
pike.git/src/cpp.cmod:1225:    if(outp) string_builder_putchar(nf, INDEX_PCHARP(data,pos-1));    continue;    }    break;    }    if(outp) string_builder_putchar(nf, '"');    while(trailing_newlines--) PUTNL();    return pos;   }    - static ptrdiff_t find_end_of_line( struct cpp *this, const PCHARP data, + static ptrdiff_t find_end_of_line( struct CPP_struct *this, const PCHARP data,    ptrdiff_t len, ptrdiff_t pos, int emit )   {    while(pos < len) {    switch (INDEX_PCHARP(data,pos++)) {    case '\n':    return pos-1;    case '\\':    if (INDEX_PCHARP(data,pos) == '\n') {    pos+=2;    } else if ((INDEX_PCHARP(data,pos) == '\r') &&
pike.git/src/cpp.cmod:1250:    continue;    }    this->current_line++;    if( emit ) PUTNL();    }    }    return pos;   }       - static ptrdiff_t find_end_of_comment( struct cpp *this, const PCHARP data, ptrdiff_t len, + static ptrdiff_t find_end_of_comment( struct CPP_struct *this, const PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int emit)   {    pos++;       while(INDEX_PCHARP(data,pos)!='*' || INDEX_PCHARP(data,pos+1)!='/')    {    if(pos+2>=len)    {    cpp_error(this,"End of file in comment.");    break;
pike.git/src/cpp.cmod:1273:    if(INDEX_PCHARP(data,pos)=='\n')    {    this->current_line++;    if( emit )PUTNL();    }    pos++;    }    return pos + 2;   }    - static ptrdiff_t find_end_quote(struct cpp *this, const PCHARP data, + static ptrdiff_t find_end_quote(struct CPP_struct *this, const PCHARP data,    ptrdiff_t len, ptrdiff_t pos,    p_wchar2 quote, int flags)   {    while(1)    {    p_wchar2 c;       if(pos>=len)    {    if (quote == '\'') {
pike.git/src/cpp.cmod:1323:    pos++;    PUTNL();    }    pos++;    }    }    return pos;   }       - static ptrdiff_t find_end_brace(struct cpp *this, + static ptrdiff_t find_end_brace(struct CPP_struct *this,    PCHARP data,    ptrdiff_t len,    ptrdiff_t pos);    - static ptrdiff_t find_end_parenthesis(struct cpp *this, + static ptrdiff_t find_end_parenthesis(struct CPP_struct *this,    PCHARP data,    ptrdiff_t len,    ptrdiff_t pos)   /* pos is after the open paren. Returns the position after the close paren. */   {    INT_TYPE start_line = this->current_line;    while(1)    {    if(pos+1>=len)    {
pike.git/src/cpp.cmod:1365:    if (INDEX_PCHARP(data,pos) == '*') {    pos = find_end_of_comment(this,data,len,pos+1,0);    } else if (INDEX_PCHARP(data,pos) == '/') {    pos = find_end_of_line(this,data,len,pos+1,0);    }    }    }   }       - static ptrdiff_t find_end_brace(struct cpp *this, + static ptrdiff_t find_end_brace(struct CPP_struct *this,    const PCHARP data,    ptrdiff_t len,    ptrdiff_t pos)   /* pos is after the open brace. Returns the position after the close brace. */   {    INT_TYPE start_line = this->current_line;    while(1)    {    if(pos+1>=len)    {
pike.git/src/cpp.cmod:1400:    case '/':    if (INDEX_PCHARP(data,pos) == '*') {    pos=find_end_of_comment(this,data,len,pos,0);    } else if (INDEX_PCHARP(data,pos) == '/') {    pos=find_end_of_line(this,data,len,pos,0);    }    }    }   }    - static struct pike_string *gobble_identifier (struct cpp *this, const PCHARP data, ptrdiff_t *pos) + static struct pike_string *gobble_identifier (struct CPP_struct *this, const PCHARP data, ptrdiff_t *pos)   {    ptrdiff_t p = *pos;    struct string_builder sb;    p_wchar2 tmp;    if( !wide_isidchar( tmp = INDEX_PCHARP(data,*pos)) && tmp != '\\' )    return NULL;       init_string_builder (&sb, 0); /* in fact, 0 is more likely than data.shift */       while (1) {
pike.git/src/cpp.cmod:1521:    *!    *! @example    *! // Strip debug    *! #define werror(X ...) 0    *! #include "/home/someone/experimental/stuff.h"    *! #undef werror    *!    *! @seealso    *! @[#define], @[defined()]    */ - static void undefine(struct cpp *this, struct pike_string *name) + static void undefine(struct CPP_struct *this, struct pike_string *name)   {    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. */
pike.git/src/cpp.cmod:1568:    *! #define @b{@i{<identifier>@}@}(arg1, arg2) @i{<replacement string>@}    *! @endcode    *!    *! would cause @tt{@b{@i{<identifer>@}@}@} to be a macro. All occurances of    *! '@tt{@b{@i{<identifier>@}@}(something1,something2d)@}' would be replaced    *! with the @tt{@i{<replacement string>@}@}.    *! And in the @tt{@i{<replacement string>@}@}, @tt{arg1@} and @tt{arg2@}    *! will be replaced with @tt{something1@} and @tt{something2@}.    */    - static struct pike_string *make_define_name(struct cpp *this, + static struct pike_string *make_define_name(struct CPP_struct *this,    const char *name)   {    if (this->prefix) {    struct string_builder s;    int len = strlen(name);       init_string_builder(&s, 0);    string_builder_append(&s, MKPCHARP_STR(this->prefix),    this->prefix->len);    string_builder_putchar(&s, '_');    string_builder_binary_strcat(&s, name, len);    return finish_string_builder(&s);    }    return make_shared_string(name);   }    - static struct define_struct *do_magic_define(struct cpp *this, + static struct define_struct *do_magic_define(struct CPP_struct *this,    const char *name,    magic_define_fun fun)   {    struct define_struct* def;    struct pike_string *name_str = make_define_name(this, name);    def = alloc_empty_define(name_str);    free_string(name_str);    def->magic=fun;    mapping_string_insert(this->defines, def->name, Pike_sp-1);    pop_stack();    return def;   }    - static void add_define(struct cpp *this, + static void add_define(struct CPP_struct *this,    struct pike_string *name,    struct pike_string *what)   {    struct define_struct* def;    def=alloc_empty_define(name);    ref_push_string(what);    f_aggregate(1);    def->parts = Pike_sp[-1].u.array;    Pike_sp--;    mapping_string_insert(this->defines, def->name, Pike_sp-1);    pop_stack();   }    - static void simple_add_define(struct cpp *this, + static void simple_add_define(struct CPP_struct *this,    const char *name,    const char *what)   {       struct pike_string *name_str = make_define_name(this, name);    struct pike_string *what_str = make_shared_string(what);    add_define(this, name_str, what_str);    free_string(what_str);    free_string(name_str);   }    - static struct pike_string *recode_string(struct cpp *this, struct pike_string *data) + static struct pike_string *recode_string(struct CPP_struct *this, struct pike_string *data)   {    /* Observations:    *    * * At least a prefix of two bytes need to be 7bit in a valid    * Pike program.    *    * * NUL isn't valid in a Pike program.    */    /* Heuristic:    *
pike.git/src/cpp.cmod:1960:   static void add_quoted_string( const void *str, ptrdiff_t len, int shift,    struct string_builder *dst )   {    struct pike_string *x = make_shared_binary_pcharp( MKPCHARP(str,shift), len );    string_builder_putchar( dst, '"' );    string_builder_quote_string( dst, x, 0, 0x7fffffff, 0 );    string_builder_putchar( dst, '"' );    free_string(x);   }    - static ptrdiff_t find_eos( struct cpp *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos ) + static ptrdiff_t find_eos( struct CPP_struct *this, const PCHARP data, ptrdiff_t len, ptrdiff_t pos )   {    while(pos < len)    {    switch (DATA(pos++)) {    case '\n':    break;    case '/':    if (DATA(pos) == '/') {    pos = find_end_of_line(this,data,len,pos,0);    break;
pike.git/src/cpp.cmod:1994:    this->current_line++;    default:    continue;    }    this->current_line++;    break;    }    return pos;   }    - static ptrdiff_t skipwhite(struct cpp *this, const PCHARP data, ptrdiff_t pos) + static ptrdiff_t skipwhite(struct CPP_struct *this, const PCHARP data, ptrdiff_t pos)   {    do    {    int c;    if(!wide_isspace(c=DATA(pos)))    {    if (c == '\\')    {    if (DATA(pos+1) == '\n')    {
pike.git/src/cpp.cmod:2028:    }    else if(c=='\n')    {    PUTNL(); this->current_line++;    }    pos++;    } while(1);    return pos;   }    - static ptrdiff_t skipspace(struct cpp *this, const PCHARP data, ptrdiff_t pos, int emit) + static ptrdiff_t skipspace(struct CPP_struct *this, const PCHARP data, ptrdiff_t pos, int emit)   {    do {    int c;    while (wide_isspace(c=DATA(pos)) && c!='\n') {    pos++;    }    if (c == '\\') {    if (DATA(pos+1) == '\n') {    pos+=2;    } else if ((DATA(pos+1) == '\r') &&
pike.git/src/cpp.cmod:2102:    for( i=0; i<len; i++ )    if( INDEX_PCHARP(stack,i) != prefix[i] )    return 0;       if( whole && len != remain && wide_isidchar(INDEX_PCHARP(stack,len)) )    return 0;       return 1;   }    - static ptrdiff_t low_cpp(struct cpp *this, + static ptrdiff_t low_cpp(struct CPP_struct *this,    PCHARP data,    ptrdiff_t len,    int flags,    int auto_convert,    struct pike_string *charset); - static void insert_callback_define(struct cpp *this, + static void insert_callback_define(struct CPP_struct *this,    struct define_struct *def,    struct pike_string *arg,    struct string_builder *tmp); - static void insert_callback_define_no_args(struct cpp *this, + static void insert_callback_define_no_args(struct CPP_struct *this,    struct define_struct *def,    struct pike_string *arg,    struct string_builder *tmp); - static void insert_pragma(struct cpp *this, + static void insert_pragma(struct CPP_struct *this,    struct define_struct *def,    struct pike_string *arg,    struct string_builder *tmp);    - static ptrdiff_t calc1(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc1(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags);    - static ptrdiff_t calcC(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calcC(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    SKIPWHITE();       CALC_DUMPPOS("calcC");       switch(DATA(pos))    {    case '(':    pos=calc1(this,data,len,pos+1,flags);
pike.git/src/cpp.cmod:2362:    f_index(2);       SKIPWHITE();    if(!GOBBLE(']'))    cpp_error(this, "Missing ']'.");    }    CALC_DUMPPOS("after calcC");    return pos;   }    - static ptrdiff_t calcB(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calcB(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calcB");       SKIPWHITE();    switch(DATA(pos))    {    case '-': pos++; pos=calcB(this,data,len,pos,flags);    if(OUTP()) o_negate(); break;    case '!': pos++; pos=calcB(this,data,len,pos,flags);    if(OUTP()) o_not(); break;    case '~': pos++; pos=calcB(this,data,len,pos,flags);    if(OUTP()) o_compl(); break;    default: pos=calcC(this,data,len,pos,flags);    }    CALC_DUMPPOS("after calcB");    return pos;   }    - static ptrdiff_t calcA(struct cpp *this,PCHARP data, ptrdiff_t len, + static ptrdiff_t calcA(struct CPP_struct *this,PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calcA");       pos=calcB(this,data,len,pos,flags);    while(1)    {    CALC_DUMPPOS("inside calcA");    SKIPWHITE();    switch(DATA(pos))
pike.git/src/cpp.cmod:2424:    if(OUTP())    o_mod();    continue;    }    break;    }    CALC_DUMPPOS("after calcA");    return pos;   }    - static ptrdiff_t calc9(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc9(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc9");       pos=calcA(this,data,len,pos,flags);       while(1)    {    CALC_DUMPPOS("inside calc9");    SKIPWHITE();
pike.git/src/cpp.cmod:2458:    o_subtract();    continue;    }    break;    }       CALC_DUMPPOS("after calc9");    return pos;   }    - static ptrdiff_t calc8(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc8(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc8");       pos=calc9(this,data,len,pos,flags);       while(1)    {    CALC_DUMPPOS("inside calc8");    SKIPWHITE();
pike.git/src/cpp.cmod:2492:    if(OUTP())    o_rsh();    break;    }       break;    }    return pos;   }    - static ptrdiff_t calc7b(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc7b(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc7b");       pos=calc8(this,data,len,pos,flags);       while(1)    {    CALC_DUMPPOS("inside calc7b");   
pike.git/src/cpp.cmod:2542:    if(OUTP())    f_gt(2);    }    continue;    }    break;    }    return pos;   }    - static ptrdiff_t calc7(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc7(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc7");       pos=calc7b(this,data,len,pos,flags);       while(1)    {    CALC_DUMPPOS("inside calc7");   
pike.git/src/cpp.cmod:2575:    if(OUTP())    f_ne(2);    continue;    }       break;    }    return pos;   }    - static ptrdiff_t calc6(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc6(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc6");       pos=calc7(this,data,len,pos,flags);       SKIPWHITE();    while(DATA(pos) == '&' && DATA(pos+1)!='&')    {    CALC_DUMPPOS("inside calc6");       pos++;    pos=calc7(this,data,len,pos,flags);    if(OUTP())    o_and();    }    return pos;   }    - static ptrdiff_t calc5(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc5(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc5");       pos=calc6(this,data,len,pos,flags);       SKIPWHITE();    while(GOBBLE('^'))    {    CALC_DUMPPOS("inside calc5");       pos=calc6(this,data,len,pos,flags);    if(OUTP())    o_xor();    }    return pos;   }    - static ptrdiff_t calc4(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc4(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc4");       pos=calc5(this,data,len,pos,flags);       SKIPWHITE();    while(DATA(pos) == '|' && DATA(pos+1)!='|')    {    CALC_DUMPPOS("inside calc4");    pos++;    pos=calc5(this,data,len,pos,flags);    if(OUTP())    o_or();    }    return pos;   }    - static ptrdiff_t calc3(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc3(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {       CALC_DUMPPOS("before calc3");       pos=calc4(this,data,len,pos,flags);       SKIPWHITE();    while(HAS_PREFIX(land_))    {
pike.git/src/cpp.cmod:2661:    }else{    pop_stack();    pos=calc4(this,data,len,pos,flags);    }    } else    pos=calc4(this,data,len,pos,flags);    }    return pos;   }    - static ptrdiff_t calc2(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc2(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {       CALC_DUMPPOS("before calc2");       pos=calc3(this,data,len,pos,flags);       SKIPWHITE();    while(HAS_PREFIX(lor_))    {
pike.git/src/cpp.cmod:2689:    }else{    pop_stack();    pos=calc3(this,data,len,pos,flags);    }    } else    pos=calc3(this,data,len,pos,flags);    }    return pos;   }    - static ptrdiff_t calc1(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc1(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t pos, int flags)   {    CALC_DUMPPOS("before calc1");       pos=calc2(this,data,len,pos,flags);       SKIPWHITE();       if(GOBBLE('?'))    {
pike.git/src/cpp.cmod:2714:    pop_stack();    }    pos=calc1(this,data,len,pos,(select == 1? flags:(flags|CPP_REALLY_NO_OUTPUT)));    if(!GOBBLE(':'))    cpp_error(this, "Colon expected.");    pos=calc1(this,data,len,pos,(select == 0? flags:(flags|CPP_REALLY_NO_OUTPUT)));    }    return pos;   }    - static ptrdiff_t calc(struct cpp *this, PCHARP data, ptrdiff_t len, + static ptrdiff_t calc(struct CPP_struct *this, PCHARP data, ptrdiff_t len,    ptrdiff_t tmp, int flags)   {    JMP_BUF recovery;    ptrdiff_t pos;       CALC_DUMPPOS("Calculating");       if (SETJMP(recovery))    {    cpp_handle_exception (this, "Error evaluating expression.");
pike.git/src/cpp.cmod:2795:    e = 0;    } else {    e++;    }    }    if (l) {    string_builder_append(s,a,l);    }   }    - static void apply_define(struct cpp *this, + static void apply_define(struct CPP_struct *this,    struct define_struct *d,    struct define_argument *arguments,    short flags, short auto_convert,    struct pike_string *charset)   {    struct string_builder tmp;       init_string_builder(&tmp, 0);    if(d->magic)    {
pike.git/src/cpp.cmod:2927:      #include "preprocessor.h"      /*** Magic defines ***/      /*! @decl constant __LINE__    *!    *! This define contains the current line number, represented as an    *! integer, in the source file.    */ - static void insert_current_line(struct cpp *this, + static void insert_current_line(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    string_builder_sprintf(tmp, " %ld ", (long)this->current_line);   }      /*! @decl constant __FILE__    *!    *! This define contains the file path and name of the source file.    */ - static void insert_current_file_as_string(struct cpp *this, + static void insert_current_file_as_string(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    PUSH_STRING_SHIFT(this->current_file->str, this->current_file->len,    this->current_file->size_shift, tmp);   }      /*! @decl constant __DIR__    *!    *! This define contains the directory path of the source file.    */ - static void insert_current_dir_as_string(struct cpp *this, + static void insert_current_dir_as_string(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    ref_push_string(this->current_file);    /* FIXME: This isn't safe if the master hasn't been compiled yet. */    SAFE_APPLY_MASTER("dirname",1);    PUSH_STRING_SHIFT(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len,    Pike_sp[-1].u.string->size_shift, tmp);    pop_stack();   }      /*! @decl constant __TIME__    *!    *! This define contains the current time at the time of compilation,    *! e.g. "12:20:51".    */ - static void insert_current_time_as_string(struct cpp *UNUSED(this), + static void insert_current_time_as_string(struct CPP_struct *UNUSED(this),    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    /* FIXME: Is this code safe? */    time_t tmp2;    char *buf;    time(&tmp2);    buf=ctime(&tmp2);       PUSH_STRING0((p_wchar0 *)buf+11, 8, tmp);   }      /*! @decl constant __DATE__    *!    *! This define contains the current date at the time of compilation,    *! e.g. "Jul 28 2001".    */ - static void insert_current_date_as_string(struct cpp *UNUSED(this), + static void insert_current_date_as_string(struct CPP_struct *UNUSED(this),    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    /* FIXME: Is this code safe? */    time_t tmp2;    char *buf;    time(&tmp2);    buf=ctime(&tmp2);   
pike.git/src/cpp.cmod:3013:      /*! @decl constant __VERSION__    *!    *! This define contains the current Pike version as a float. If    *! another Pike version is emulated, this define is updated    *! accordingly.    *!    *! @seealso    *! @[__REAL_VERSION__]    */ - static void insert_current_version(struct cpp *this, + static void insert_current_version(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    string_builder_sprintf(tmp, " %d.%d ", this->compat_major,    this->compat_minor);   }         /*! @decl constant __MINOR__    *! This define contains the minor part of the current Pike version,    *! represented as an integer. If another Pike version is emulated,    *! this define is updated accordingly.    *!    *! @seealso    *! @[__REAL_MINOR__]    */ - static void insert_current_minor(struct cpp *this, + static void insert_current_minor(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    string_builder_sprintf(tmp, " %d ", this->compat_minor);   }      /*! @decl int(1..) __COUNTER__    *! This define contains a unique counter (unless it has been expanded    *! Int.NATIVE_MAX times) represented as an integer.    *!    */ - static void insert_current_counter(struct cpp *UNUSED(this), + static void insert_current_counter(struct CPP_struct *UNUSED(this),    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    static int counter = 0;    string_builder_sprintf(tmp, " %d ", ++counter);   }      /*! @decl constant __MAJOR__    *!    *! This define contains the major part of the current Pike version,    *! represented as an integer. If another Pike version is emulated,    *! this define is updated accordingly.    *!    *! @seealso    *! @[__REAL_MAJOR__]    */ - static void insert_current_major(struct cpp *this, + static void insert_current_major(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    string_builder_sprintf(tmp, " %d ", this->compat_major);   }      /* _Pragma(STRING) */   /*! @decl void _Pragma(string directive)    *!    *! This macro inserts the corresponding @[#pragma] @[directive]    *! in the source.    *!    *! e.g. @expr{_Pragma("strict_types")@} is the same    *! as @expr{#pragma strict_types@} .    *!    *! @seealso    *! @[#pragma]    */ - static void insert_pragma(struct cpp *this, + static void insert_pragma(struct CPP_struct *this,    struct define_struct *UNUSED(def),    struct pike_string *arg,    struct string_builder *tmp)   {    int i;    int in_string = 0;       /* Make some reasonable amount of space. */    string_build_mkspace(tmp, arg->len + 20, arg->size_shift);   
pike.git/src/cpp.cmod:3141:    }       string_builder_sprintf(tmp, "\n#line %ld ", (long)this->current_line);    PUSH_STRING_SHIFT(this->current_file->str,    this->current_file->len,    this->current_file->size_shift,    tmp);    string_builder_putchar(tmp, '\n');   }    - static void insert_callback_define(struct cpp *this, + static void insert_callback_define(struct CPP_struct *this,    struct define_struct *def,    struct pike_string *arg,    struct string_builder *tmp)   {    ref_push_string( def->name );    ref_push_string( arg );    if (safe_apply_handler( "evaluate_define",    this->handler, this->compat_handler, 2, 0 ) &&    TYPEOF(Pike_sp[-1]) == T_STRING ) {    string_builder_shared_strcat(tmp, Pike_sp[-1].u.string);
pike.git/src/cpp.cmod:3166:    {    string_builder_sprintf(tmp, "\n#line %ld ", (long)this->current_line);    insert_current_file_as_string( this,def,arg,tmp);    string_builder_putchar(tmp, '\n');    }    }    pop_stack();    }   }    - static void insert_callback_define_no_args(struct cpp *this, + static void insert_callback_define_no_args(struct CPP_struct *this,    struct define_struct *def,    struct pike_string *UNUSED(arg),    struct string_builder *tmp)   {    struct svalue *save_sp = Pike_sp;    ref_push_string( def->name );    if (safe_apply_handler( "evaluate_define",    this->handler, this->compat_handler, 1, 0 ) &&    TYPEOF(Pike_sp[-1]) == T_STRING )    string_builder_shared_strcat(tmp, Pike_sp[-1].u.string);
pike.git/src/cpp.cmod:3318:    *! If a prefix is given, only prefixed directives will be    *! processed. For example, if the prefix is @expr{"foo"@}, then    *! @expr{#foo_ifdef COND@} and @expr{foo___LINE__@} would be    *! processed, @expr{#ifdef COND@} and @expr{__LINE__@} would not.    *! @endmapping    *!    *! @seealso    *! @[compile()]    */    - /* Doesn't free string_builder buf! */ - static void free_cpp(struct cpp *this) - { -  if(this->defines) -  free_mapping(this->defines); -  -  if(this->current_file) -  free_string(this->current_file); -  -  if(this->handler) { -  free_object(this->handler); -  this->handler = 0; -  } -  -  if(this->compat_handler) { -  free_object(this->compat_handler); -  this->compat_handler=0; -  } -  -  if(this->data) -  free_string(this->data); -  -  if(this->prefix) -  free_string(this->prefix); - } -  -  +    PIKEFUN string cpp(string data,    mapping|string|void opts_or_file,    int|string|void charset_sv,    object|void handler,    int|void compat_major_sv,    int|void compat_minor_sv,    int|void picky_cpp_sv)    efun;   { -  struct cpp this; +  struct object *cpp_obj = fast_clone_object(CPP_program); +  struct CPP_struct *this = +  (struct CPP_struct *)get_storage(cpp_obj, CPP_program);    struct svalue *save_sp = Pike_sp - args;    struct mapping *predefs = NULL;       struct pike_string *prefix = NULL;       struct pike_string *current_file = 0;       int auto_convert = 0;    struct pike_string *charset = NULL;       int compat_major = compat_major_sv?compat_major_sv->u.integer:0;    int compat_minor = compat_minor_sv?compat_minor_sv->u.integer:0;    int picky_cpp = picky_cpp_sv?picky_cpp_sv->u.integer:0;    -  ONERROR err; +    #ifdef PIKE_DEBUG    ONERROR tmp;   #endif /* PIKE_DEBUG */    -  this.prefix = NULL; -  this.current_line=1; -  this.compile_errors=0; -  this.defines = allocate_mapping(32); -  this.keep_comments = 0; -  this.dependencies_fail = 0; +  push_object(cpp_obj);    -  +  this->prefix = NULL; +  this->current_line=1; +  this->compile_errors=0; +  this->defines = allocate_mapping(32); +  this->keep_comments = 0; +  this->dependencies_fail = 0; +     if (opts_or_file) {    if (TYPEOF(*opts_or_file) == PIKE_T_MAPPING) {    struct svalue *tmp;    struct mapping *m = opts_or_file->u.mapping;      #define GET_TYPE(type, name) ((tmp = simple_mapping_string_lookup(m, name)) \    && (TYPEOF(*(tmp)) == PIKE_T_##type || (Pike_error("Expected type %s,"\    "got type %s for " name ".", get_name_of_type(PIKE_T_##type), get_name_of_type(TYPEOF(*tmp))), 0)))       if (GET_TYPE(STRING, "current_file")) current_file = tmp->u.string;    if (GET_TYPE(STRING, "charset")) charset_sv = tmp;    if (GET_TYPE(OBJECT, "handler")) handler = tmp->u.object;    if (GET_TYPE(INT, "compat_major")) compat_major = tmp->u.integer;    if (GET_TYPE(INT, "compat_minor")) compat_minor = tmp->u.integer;    if (GET_TYPE(INT, "picky")) picky_cpp = tmp->u.integer;    if (GET_TYPE(STRING, "prefix")) prefix = tmp->u.string; -  if (GET_TYPE(INT, "keep_comments")) this.keep_comments = tmp->u.integer; +  if (GET_TYPE(INT, "keep_comments")) this->keep_comments = tmp->u.integer;   #undef GET_TYPE    } else if (TYPEOF(*opts_or_file) == PIKE_T_STRING) {    current_file = opts_or_file->u.string;    }    }    -  this.data = data; +  this->data = data;    add_ref(data);       if(current_file)    add_ref(current_file);    else    current_file = make_shared_string("-"); -  this.current_file = current_file; +  this->current_file = current_file;    -  this.compat_major=PIKE_MAJOR_VERSION; -  this.compat_minor=PIKE_MINOR_VERSION; -  this.compat_handler = 0; -  this.handler = handler; +  this->compat_major=PIKE_MAJOR_VERSION; +  this->compat_minor=PIKE_MINOR_VERSION; +  this->compat_handler = 0; +  this->handler = handler;    if(handler)    add_ref(handler);    -  /* Don't call free_cpp before all variables are cleared or set. */ -  SET_ONERROR(err, free_cpp, &this); -  +     if (prefix) {    int i;    if (prefix->size_shift) {    Pike_error("No widechars allowed in cpp prefix.\n");    }    for (i = 0; i < prefix->len; i++) {    if (!wide_isidchar(prefix->str[i])) {    Pike_error("Invalid char in prefix.\n");    }    } -  this.prefix = prefix; +  this->prefix = prefix;    add_ref(prefix);    }          if(charset_sv) {    if(TYPEOF(*charset_sv) == T_STRING) {    charset = charset_sv->u.string;    push_string(data); -  this.data = data = NULL; +  this->data = data = NULL;    ref_push_string(charset); -  if (!safe_apply_handler ("decode_charset", this.handler, -  this.compat_handler, 2, BIT_STRING)) { -  cpp_handle_exception (&this, "Error decoding with charset %S", +  if (!safe_apply_handler ("decode_charset", this->handler, +  this->compat_handler, 2, BIT_STRING)) { +  cpp_handle_exception (this, "Error decoding with charset %S",    charset);    Pike_error("Unknown charset.\n");    } -  this.data = data = Pike_sp[-1].u.string; +  this->data = data = Pike_sp[-1].u.string;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    }    else if(TYPEOF(*charset_sv) == T_INT)    auto_convert = charset_sv->u.integer;    else {    SIMPLE_ARG_TYPE_ERROR("cpp", 3, "string|int");    }    }       if(compat_major) -  cpp_change_compat(&this, compat_major, compat_minor); +  cpp_change_compat(this, compat_major, compat_minor);    -  this.picky_cpp = picky_cpp; +  this->picky_cpp = picky_cpp;       if (use_initial_predefs)    /* Typically compiling the master here. */    predefs = initial_predefs_mapping();    else { -  low_unsafe_apply_handler ("get_predefines", this.handler, -  this.compat_handler, 0); +  low_unsafe_apply_handler ("get_predefines", this->handler, +  this->compat_handler, 0);    if (!UNSAFE_IS_ZERO (Pike_sp - 1)) {    struct keypair *k;    int e, sprintf_args = 0;    if (TYPEOF(Pike_sp[-1]) != T_MAPPING) {    push_static_text ("Invalid return value from get_predefines, got %O\n");    push_svalue (Pike_sp - 3);    sprintf_args = 2;    }    else {    predefs = copy_mapping (Pike_sp[-1].u.mapping);
pike.git/src/cpp.cmod:3516:    predef_map_error:    f_sprintf (sprintf_args);    Pike_error("%S", Pike_sp[-1].u.string);    }    }    pop_stack();    }       if (auto_convert && (!data->size_shift) && (data->len > 1)) {    /* Try to determine if we need to recode the string */ -  struct pike_string *new_data = recode_string(&this, data); +  struct pike_string *new_data = recode_string(this, data);    free_string(data); -  this.data = data = new_data; +  this->data = data = new_data;    }    if (data->size_shift) {    /* Get rid of any byte order marks (0xfeff) */    struct pike_string *new_data = filter_bom(data);    free_string(data); -  this.data = data = new_data; +  this->data = data = new_data;    }    -  init_string_builder(&this.buf, 0); -  +     /* These attempt to be compatible with the C standard. */ -  do_magic_define(&this,"__LINE__",insert_current_line); -  do_magic_define(&this,"__FILE__",insert_current_file_as_string); -  do_magic_define(&this,"__DATE__",insert_current_date_as_string); -  do_magic_define(&this,"__TIME__",insert_current_time_as_string); +  do_magic_define(this,"__LINE__",insert_current_line); +  do_magic_define(this,"__FILE__",insert_current_file_as_string); +  do_magic_define(this,"__DATE__",insert_current_date_as_string); +  do_magic_define(this,"__TIME__",insert_current_time_as_string);       /* These are from the 201x C standard. */ -  do_magic_define(&this,"_Pragma",insert_pragma)->args = 1; -  simple_add_define(&this, "static_assert", "_Static_assert"); +  do_magic_define(this,"_Pragma",insert_pragma)->args = 1; +  simple_add_define(this, "static_assert", "_Static_assert");    -  simple_add_define(&this, "__ARGS__", "__args__"); +  simple_add_define(this, "__ARGS__", "__args__");    -  do_magic_define(&this,"__COUNTER__",insert_current_counter); +  do_magic_define(this,"__COUNTER__",insert_current_counter);       /* These are Pike extensions. */ -  do_magic_define(&this,"__DIR__",insert_current_dir_as_string); -  do_magic_define(&this,"__VERSION__",insert_current_version); -  do_magic_define(&this,"__MAJOR__",insert_current_major); -  do_magic_define(&this,"__MINOR__",insert_current_minor); +  do_magic_define(this,"__DIR__",insert_current_dir_as_string); +  do_magic_define(this,"__VERSION__",insert_current_version); +  do_magic_define(this,"__MAJOR__",insert_current_major); +  do_magic_define(this,"__MINOR__",insert_current_minor);       {   #if 0    /* Left in place for documentation reference purposes. */    struct define_struct *def =    alloc_empty_define(make_shared_string("__deprecated__"), 1);    def->args = 1;    REF_MAKE_CONST_STRING(def->first, "__attribute__(\"deprecated\", ");    def->parts[0].argument = 0;    REF_MAKE_CONST_STRING(def->parts[0].postfix, ")"); -  mapping_string_insert(this.defines, def->name, Pike_sp-1); +  mapping_string_insert(this->defines, def->name, Pike_sp-1);    pop_stack();   #endif /* 0 */    -  simple_add_define(&this, "__PIKE__", " 1 "); +  simple_add_define(this, "__PIKE__", " 1 ");    -  simple_add_define(&this, "__REAL_VERSION__", +  simple_add_define(this, "__REAL_VERSION__",    " " DEFINETOSTR(PIKE_MAJOR_VERSION) "."    DEFINETOSTR(PIKE_MINOR_VERSION) " "); -  simple_add_define(&this, "__REAL_MAJOR__", +  simple_add_define(this, "__REAL_MAJOR__",    " " DEFINETOSTR(PIKE_MAJOR_VERSION) " "); -  simple_add_define(&this, "__REAL_MINOR__", +  simple_add_define(this, "__REAL_MINOR__",    " " DEFINETOSTR(PIKE_MINOR_VERSION) " "); -  simple_add_define(&this, "__BUILD__", +  simple_add_define(this, "__BUILD__",    " " DEFINETOSTR(PIKE_BUILD_VERSION) " "); -  simple_add_define(&this, "__REAL_BUILD__", +  simple_add_define(this, "__REAL_BUILD__",    " " DEFINETOSTR(PIKE_BUILD_VERSION) " "); -  simple_add_define(&this, "__AUTO_BIGNUM__", " 1 "); +  simple_add_define(this, "__AUTO_BIGNUM__", " 1 ");   #ifdef __NT__ -  simple_add_define(&this, "__NT__", " 1 "); +  simple_add_define(this, "__NT__", " 1 ");   #endif   #ifdef __amigaos__ -  simple_add_define(&this, "__amigaos__", " 1 "); +  simple_add_define(this, "__amigaos__", " 1 ");   #endif   #ifdef __OS2__ -  simple_add_define(&this, "__OS2__", " 1 "); +  simple_add_define(this, "__OS2__", " 1 ");   #endif   #ifdef __APPLE__ -  simple_add_define(&this, "__APPLE__", " 1 "); +  simple_add_define(this, "__APPLE__", " 1 ");   #endif -  simple_add_define(&this, "SIZEOF_INT", +  simple_add_define(this, "SIZEOF_INT",    " " DEFINETOSTR(SIZEOF_INT) " "); -  simple_add_define(&this, "SIZEOF_FLOAT", +  simple_add_define(this, "SIZEOF_FLOAT",    " " DEFINETOSTR(SIZEOF_FLOAT) " ");    }       if (predefs) {    struct keypair *k;    int e;    NEW_MAPPING_LOOP (predefs->data) {    if (TYPEOF(k->val) == T_STRING) -  add_define (&this, k->ind.u.string, k->val.u.string); +  add_define (this, k->ind.u.string, k->val.u.string);    else if(TYPEOF(k->val) == T_FUNCTION || TYPEOF(k->val) == T_OBJECT)    {    struct define_struct *def;    if( index_shared_string( k->ind.u.string, k->ind.u.string->len-1) == ')' )    {    struct pike_string *s = string_slice( k->ind.u.string, 0, k->ind.u.string->len-2);    def = alloc_empty_define(s);    free_string(s);    def->magic = insert_callback_define;    def->varargs=1;    def->args=1;    }    else    {    def = alloc_empty_define(k->ind.u.string);    def->magic = insert_callback_define_no_args;    } -  mapping_string_insert(this.defines, def->name, Pike_sp-1); +  mapping_string_insert(this->defines, def->name, Pike_sp-1);    pop_stack();    }    else -  add_define (&this, k->ind.u.string, empty_pike_string); +  add_define (this, k->ind.u.string, empty_pike_string);    }    free_mapping (predefs);    }    -  string_builder_binary_strcat(&this.buf, "#line 1 ", 8); -  PUSH_STRING_SHIFT(this.current_file->str, this.current_file->len, -  this.current_file->size_shift, &this.buf); -  string_builder_putchar(&this.buf, '\n'); +  string_builder_binary_strcat(&this->buf, "#line 1 ", 8); +  PUSH_STRING_SHIFT(this->current_file->str, this->current_file->len, +  this->current_file->size_shift, &this->buf); +  string_builder_putchar(&this->buf, '\n');      #ifdef PIKE_DEBUG    SET_ONERROR(tmp, fatal_on_error, "Preprocessor exited with longjump!\n");   #endif /* PIKE_DEBUG */       -  low_cpp(&this, MKPCHARP_STR(data), data->len, +  low_cpp(this, MKPCHARP_STR(data), data->len,    0, auto_convert, charset);      #ifdef PIKE_DEBUG    UNSET_ONERROR(tmp);   #endif /* PIKE_DEBUG */    -  UNSET_ONERROR(err); -  free_cpp(&this); -  -  if(this.compile_errors) +  if(this->compile_errors)    { -  free_string_builder(&this.buf); +     throw_error_object(fast_clone_object(cpp_error_program), 0, 0, 0,    "Cpp() failed\n");    } -  else if(this.dependencies_fail) +  else if(this->dependencies_fail)    { -  free_string_builder(&this.buf); -  pop_n_elems(Pike_sp - save_sp); +     push_int(0);    }    else    { -  pop_n_elems(Pike_sp - save_sp); -  push_string(finish_string_builder(&this.buf)); +  push_string(finish_string_builder(&this->buf)); +  /* NB: Make sure the buffer isn't freed twice. */ +  this->buf.s = NULL;    } -  +  stack_pop_n_elems_keep_top((Pike_sp - save_sp) - 1);   }      /*! @module Builtin    */      /*! @decl mapping(string:mixed) _take_over_initial_predefines()    */   void f__take_over_initial_predefines (INT32 args)   {    pop_n_elems (args);