This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __cplusplus revisited


stephen.webb@cybersafe.com wrote:-

> I have several flavours of Solaris.  Could someone give me links to
> the problem and I'll see what I can do?

OK, great.  Apply the patch below and bootstrap C and C++.  The
problems are that defining __cplusplus to 199711L reveals different
aspects of the Solaris headers owing to conditional compilation, and
some conflicts occur.  I'm not sure if they occur during compiling
libstdc++, or after installation when compiling normal user code.

The thread starts at

http://gcc.gnu.org/ml/gcc-patches/2001-01/msg01982.html

and Benjamin's post describes what the problems might be.

http://gcc.gnu.org/ml/gcc-patches/2001-01/msg02028.html

Neil.

Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.144
diff -u -p -r1.144 cppinit.c
--- cppinit.c	2001/01/24 18:44:40	1.144
+++ cppinit.c	2001/01/26 07:53:05
@@ -418,7 +418,6 @@ set_lang (pfile, lang)
 
       /* Objective C.  */
     case CLK_OBJCXX:
-      new_pending_directive (pend, "__cplusplus", cpp_define);
       CPP_OPTION (pfile, cplusplus) = 1;
     case CLK_OBJC:
       CPP_OPTION (pfile, trigraphs) = 0;
@@ -439,7 +438,6 @@ set_lang (pfile, lang)
       CPP_OPTION (pfile, cplusplus_comments) = 1;
       CPP_OPTION (pfile, digraphs) = 1;
       CPP_OPTION (pfile, c99) = 0;
-      new_pending_directive (pend, "__cplusplus", cpp_define);
       break;
 
       /* Assembler.  */
@@ -749,6 +747,10 @@ init_builtins (pfile)
 	  _cpp_define_builtin (pfile, str);
 	}
     }
+
+  /* This is the right place to do the option-dependent builtins, too.  */
+  if (CPP_OPTION (pfile, cplusplus))
+    _cpp_define_builtin (pfile, "__cplusplus 199711L");
 }
 #undef BUILTIN
 #undef OPERATOR


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]