aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 4066ee3..96ac9a4 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -327,10 +327,12 @@ mark_named_operators (pfile)
}
/* Read the builtins table above and enter them, and language-specific
- macros, into the hash table. */
+ macros, into the hash table. HOSTED is true if this is a hosted
+ environment. */
void
-cpp_init_builtins (pfile)
+cpp_init_builtins (pfile, hosted)
cpp_reader *pfile;
+ int hosted;
{
const struct builtin *b;
size_t n = ARRAY_SIZE (builtin_array);
@@ -355,6 +357,11 @@ cpp_init_builtins (pfile)
else if (CPP_OPTION (pfile, c99))
_cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");
+ if (hosted)
+ cpp_define (pfile, "__STDC_HOSTED__=1");
+ else
+ cpp_define (pfile, "__STDC_HOSTED__=0");
+
if (CPP_OPTION (pfile, objc))
_cpp_define_builtin (pfile, "__OBJC__ 1");
}