pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:5347:    struct object *cpp_obj =    parent_clone_object(CPP_program,    compilation_environment, CPP_program_fun_num,    args-1);    struct CPP_struct *this =    (struct CPP_struct *)get_storage(cpp_obj, CPP_program);    struct mapping *predefs = NULL;       push_object(cpp_obj);    -  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); -  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); -  NEW_MAPPING_LOOP (predefs->data) { -  if (TYPEOF(k->ind) != T_STRING || !k->ind.u.string->len) { -  push_static_text ("Expected nonempty string as predefine name, got %O\n"); -  push_svalue (&k->ind); -  sprintf_args = 2; -  free_mapping (predefs); -  predefs = NULL; -  goto predef_map_error; -  } else if (!(TYPEOF(k->val) == T_INT && !k->val.u.integer) -  && TYPEOF(k->val) != T_STRING -  && TYPEOF(k->val) != T_FUNCTION -  && TYPEOF(k->val) != T_OBJECT) { +  apply(cpp_obj, "init_pike_cpp", 0);    -  push_static_text ("expected zero, string or function value for" -  " predefine %O\n"); -  push_svalue (&k->ind); -  sprintf_args = 2; -  free_mapping (predefs); -  predefs = NULL; -  goto predef_map_error; -  } -  } -  } -  if (!predefs) { -  predef_map_error: -  f_sprintf (sprintf_args); -  Pike_error("%S", Pike_sp[-1].u.string); -  } -  } -  pop_stack(); -  } -  -  apply(cpp_obj, "define_ansi_macros", 0); -  -  apply(cpp_obj, "define_pike_macros", 0); -  -  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); -  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->flags |= CPP_MACRO_VARARGS; -  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); -  pop_stack(); -  } -  else -  add_define (this, k->ind.u.string, empty_pike_string); -  } -  free_mapping (predefs); -  } -  +     if (this->charset) {    ref_push_string(data);    ref_push_string(this->charset);    if (!safe_apply_handler ("decode_charset", this->handler,    this->compat_handler, 2, BIT_STRING)) {    cpp_handle_exception (this, "Error decoding with charset %S",    THIS->charset);    Pike_error("Unknown charset.\n");    }    data = Pike_sp[-1].u.string;