]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (cb_register_builtins): If C++, define __EXCEPTIONS, __DEPRECATED and...
authorNeil Booth <neil@daikokuya.co.uk>
Thu, 1 Aug 2002 06:25:06 +0000 (06:25 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Thu, 1 Aug 2002 06:25:06 +0000 (06:25 +0000)
* c-common.c (cb_register_builtins): If C++, define
__EXCEPTIONS, __DEPRECATED and __GXX_ABI_VERSION as appropriate.
* gcc.c (cpp_unique_options): Remove __GXX_ABI_VERSION.
cp:
* lang-specs.h: Simplify in accordance with new code in
c-common.c.

From-SVN: r55924

gcc/ChangeLog
gcc/c-common.c
gcc/cp/lang-specs.h
gcc/gcc.c

index 49a41f816be51c614a5971416617359f255f2f05..f467337dcd97f94fd1c9e12b4e637a0eac359134 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-01  Neil Booth  <neil@daikokuya.co.uk>
+
+       * c-common.c (cb_register_builtins): If C++, define
+       __EXCEPTIONS, __DEPRECATED and __GXX_ABI_VERSION as appropriate.
+       * gcc.c (cpp_unique_options): Remove __GXX_ABI_VERSION.
+cp:
+       * lang-specs.h: Simplify in accordance with new code in
+       c-common.c.
+
 2002-08-01  Neil Booth  <neil@daikokuya.co.uk>
 
        * c-common.c: Define all C/ObjC/C++ warning and flag variables.
index 7eb391a768af73d7cb0ad9986fabd3e346fabb8d..784cc643e2f8c896d4f4994e4c0d2f9fe56c58a8 100644 (file)
@@ -4728,6 +4728,11 @@ cb_register_builtins (pfile)
        cpp_define (pfile, "__GXX_WEAK__=1");
       else
        cpp_define (pfile, "__GXX_WEAK__=0");
+      if (flag_exceptions)
+       cpp_define (pfile, "__EXCEPTIONS");
+      if (warn_deprecated)
+       cpp_define (pfile, "__DEPRECATED");
+      cpp_define (pfile, "__GXX_ABI_VERSION__=101");
     }
 
   /* libgcc needs to know this.  */
index f35ff716adfcec333b6c307708e1a74e461471e0..7b8711666a671b69aba0953e709b0fafc59525ed 100644 (file)
@@ -33,28 +33,16 @@ Boston, MA 02111-1307, USA.  */
   {".c++", "@c++", 0},
   {".C",   "@c++", 0},
   {"@c++",
-   /* cc1plus has an integrated ISO C preprocessor.  We should invoke
-      the external preprocessor if -save-temps is given.  */
+     /* We should convert -ansi to -std=c++98 even if -fpreprocessed,
+       to get dollars in identifiers correct.  */
     "%{E|M|MM:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
-       %{!Wno-deprecated:-D__DEPRECATED}\
-       %{!fno-exceptions:-D__EXCEPTIONS}\
-       %{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options) %2\
-       %(cpp_debug_options)}\
+       %{ansi:-std=c++98} %(cpp_options) %2 %(cpp_debug_options)}\
      %{!E:%{!M:%{!MM:\
-       %{save-temps:cc1plus -E \
-                   %{!no-gcc:-D__GNUG__=%v1}\
-                           %{!Wno-deprecated:-D__DEPRECATED}\
-                   %{!fno-exceptions:-D__EXCEPTIONS}\
-                   %{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
-                   %(cpp_options) %2 %b.ii \n}\
+       %{save-temps:cc1plus -E %{!no-gcc:-D__GNUG__=%v1}\
+               %{ansi:-std=c++98} %(cpp_options) %2 %b.ii \n}\
       cc1plus %{save-temps:-fpreprocessed %b.ii}\
-              %{!save-temps:%(cpp_unique_options)\
-                           %{!no-gcc:-D__GNUG__=%v1} \
-                                   %{!Wno-deprecated:-D__DEPRECATED}\
-                           %{!fno-exceptions:-D__EXCEPTIONS}\
-                           %{ansi:-D__STRICT_ANSI__}}\
-       %{ansi:-trigraphs -$}\
-       %(cc1_options) %2 %{+e1*}\
+             %{!save-temps:%(cpp_unique_options) %{!no-gcc:-D__GNUG__=%v1}}\
+       %{ansi:-std=c++98} %(cc1_options) %2 %{+e1*}\
        %{!fsyntax-only:%(invoke_as)}}}}",
      CPLUSPLUS_CPP_SPEC},
   {".ii", "@c++-cpp-output", 0},
index cd55240df720ea6cd64490b9b7d86f119c55239a..4e1ba5d6dce453b60adf0a308e1e501e24aba9a3 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -675,7 +675,7 @@ static const char *cpp_unique_options =
  %{MMD:-MMD %W{!o: %b.d}%W{o*:%.d%*}}\
  %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
  %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\
- %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3 -D__GXX_ABI_VERSION=101}\
+ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
  %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\
  %{E|M|MM:%W{o*}}";