From 6e2701797a3dc551e6216c5febe182d771922ba5 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 11 May 2003 13:43:36 +0000 Subject: 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 --- gcc/cppinit.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/cppinit.c') 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"); } -- cgit v1.1