summaryrefslogtreecommitdiffstats
path: root/contrib/gcclibs/libcpp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcclibs/libcpp/init.c')
-rw-r--r--contrib/gcclibs/libcpp/init.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/contrib/gcclibs/libcpp/init.c b/contrib/gcclibs/libcpp/init.c
index 8280f2f..248d84f 100644
--- a/contrib/gcclibs/libcpp/init.c
+++ b/contrib/gcclibs/libcpp/init.c
@@ -348,11 +348,8 @@ mark_named_operators (cpp_reader *pfile)
}
}
-/* Read the builtins table above and enter them, and language-specific
- macros, into the hash table. HOSTED is true if this is a hosted
- environment. */
void
-cpp_init_builtins (cpp_reader *pfile, int hosted)
+cpp_init_special_builtins (cpp_reader *pfile)
{
const struct builtin *b;
size_t n = ARRAY_SIZE (builtin_array);
@@ -361,10 +358,7 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
n -= 2;
else if (! CPP_OPTION (pfile, stdc_0_in_system_headers)
|| CPP_OPTION (pfile, std))
- {
- n--;
- _cpp_define_builtin (pfile, "__STDC__ 1");
- }
+ n--;
for (b = builtin_array; b < builtin_array + n; b++)
{
@@ -373,6 +367,20 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
hp->flags |= NODE_BUILTIN | NODE_WARN;
hp->value.builtin = (enum builtin_type) b->value;
}
+}
+
+/* Read the builtins table above and enter them, and language-specific
+ macros, into the hash table. HOSTED is true if this is a hosted
+ environment. */
+void
+cpp_init_builtins (cpp_reader *pfile, int hosted)
+{
+ cpp_init_special_builtins (pfile);
+
+ if (!CPP_OPTION (pfile, traditional)
+ && (! CPP_OPTION (pfile, stdc_0_in_system_headers)
+ || CPP_OPTION (pfile, std)))
+ _cpp_define_builtin (pfile, "__STDC__ 1");
if (CPP_OPTION (pfile, cplusplus))
_cpp_define_builtin (pfile, "__cplusplus 1");
@@ -620,7 +628,8 @@ post_options (cpp_reader *pfile)
preprocessed text. Read preprocesed source in ISO mode. */
if (CPP_OPTION (pfile, preprocessed))
{
- pfile->state.prevent_expansion = 1;
+ if (!CPP_OPTION (pfile, directives_only))
+ pfile->state.prevent_expansion = 1;
CPP_OPTION (pfile, traditional) = 0;
}
OpenPOWER on IntegriCloud