aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorNeil Booth <neil@gcc.gnu.org>2003-05-11 13:43:36 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-05-11 13:43:36 +0000
commit6e2701797a3dc551e6216c5febe182d771922ba5 (patch)
tree7cab977994e83b118651dd8ede9739970a4c0152 /gcc/cppinit.c
parent8af992ea30b76cc71f3d57f90c005ed2d3671ff3 (diff)
c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a Standard Predefined Macro.
* c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a Standard Predefined Macro. * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins. * cppinit.c (_cpp_init_builtins): Take HOSTED. Define __STDC_HOSTED__ appropriately. * cpplib.h (_cpp_init_builtins): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi, doc/cppopts.texi: Update documentation. * cppfiles.c (find_or_create_entry): Preserve errno. From-SVN: r66688
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 4066ee31dbd..96ac9a46bd2 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");
}