pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:4954:    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 ((tmp = simple_mapping_string_lookup(m, "charset"))) { +  if ((TYPEOF(*tmp) == PIKE_T_STRING) || +  (TYPEOF(*tmp) == PIKE_T_INT)) { +  charset_sv = tmp; +  } else { +  Pike_error("Expected type string|int, got type %s for charset.", +  get_name_of_type(TYPEOF(*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;   #undef GET_TYPE    } else if (TYPEOF(*opts_or_file) == PIKE_T_STRING) {    current_file = opts_or_file->u.string;    }