This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: __cplusplus revisited
- To: stephen dot webb at cybersafe dot com
- Subject: Re: __cplusplus revisited
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Tue, 13 Feb 2001 19:16:30 +0000
- Cc: libstdc++ at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- References: <20010212165341.A8852@disaster.jaj.com> <01021309015700.08541@piggy>
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