Overloading vs. string functions, etc.

Phil Edwards pedwards@disaster.jaj.com
Fri May 25 13:35:00 GMT 2001


On Fri, May 25, 2001 at 09:17:41AM +0200, Andreas Jaeger wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> > Make <string.h> contain:
> > 
> >   #ifdef __cplusplus
> >   namespace std {
> >   #endif
> 
> But this would break with GCC 2.95, wouldn't it?  So it should be
> (__GNUC_PREREQ just check that we use GCC with the supplied version):
> 
> #if defined __cplusplus && __GNUC_PREREQ (3,0)
> namespace std {
> #endif

We could take advantage of the fact that the C++ Standard provides for this:

    #if __cplusplus >= 199711L
    namespace std {
    #endif

GCC 2.95 wouldn't see the namespace that way.

Currently we're still (nonconformingly) defining __cplusplus to be 1
rather than the value defined by ISO.  We tried to fix this once before,
but because Solaris already /does/ #if's like this one, we suddenly started
picking up system headers that we weren't before.  Some work on this has
already been done.


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.



More information about the Libstdc++ mailing list