pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:163:      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 ptrdiff_t calc(struct CPP_struct *this, PCHARP data, ptrdiff_t len, +  ptrdiff_t tmp, int flags); +    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_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_struct *this, const char *cpp_warn_fmt, ...) ATTRIBUTE((noinline));   struct define_struct *defined_macro = NULL;   static struct svalue defined_macro_sval;   
pike.git/src/cpp.cmod:632:   /*! @directive #require    *!    *! If the directive evaluates to false, the source file will be    *! considered to have failed dependencies, and will not be found by    *! the resolver. In practical terms the @[cpp()] call will return    *! zero.    *!    *! @seealso    *! @[#if]    */ +  PIKEFUN string(0..0) directive_require(int flags, string line) +  { +  struct CPP_struct *this = THIS;    -  +  if (OUTP()) { +  ref_push_string(line); +  push_int(CPP_DO_IF); +  apply_current(f_CPP_cpp_fun_num, 2); +  +  if (TYPEOF(Pike_sp[-1]) == PIKE_T_STRING) { +  calc(this, MKPCHARP_STR(Pike_sp[-1].u.string), +  Pike_sp[-1].u.string->len, 0, 0); +  if(SAFE_IS_ZERO(Pike_sp-1)) this->dependencies_fail=1; +  } else { +  this->dependencies_fail=1; +  } +  pop_stack(); +  } +  +  push_empty_string(); +  } +    /*! @directive #endif    *!    *! End a block opened with @[#if], @[#ifdef], @[#ifndef],    *! @[#else], @[#elseif] or @[#elif].    *!    *! @example    *! @code    *! #ifdef DEBUG    *! do_debug_stuff();    *! #endif // DEBUG
pike.git/src/cpp.cmod:4160:    cpp_change_compat(this, major, minor);    }else{    cpp_error(this, "Missing '.' in #pike.");    this->compat_minor=0;    }    }    else    FIND_EOL();    break;    } -  } -  /* FALLTHRU */ -  case 'r': /* require */ -  { -  if(GOBBLE_WORD(require_)) -  { -  struct string_builder save, tmp; -  save = this->buf; -  init_string_builder(&this->buf, 0); -  pos += low_cpp(this, ADD_PCHARP(data,pos), len-pos, -  CPP_END_AT_NEWLINE | CPP_DO_IF, -  charset); -  tmp = this->buf; -  this->buf = save; -  string_builder_putchar(&tmp, 0); -  tmp.s->len--; -  -  calc(this,MKPCHARP_STR(tmp.s),tmp.s->len,0,0); -  if(SAFE_IS_ZERO(Pike_sp-1)) this->dependencies_fail=1; -  pop_stack(); -  free_string_builder(&tmp); -  if(this->dependencies_fail) return pos; -  break; -  } +     goto unknown_preprocessor_directive;    }    default:    unknown_preprocessor_directive:    {    struct pike_string *directive = GOBBLE_IDENTIFIER();    if (directive) {    struct svalue *fun = NULL;    struct svalue sv;    struct pike_string *directive_string =