Re: [HACKERS] PATCH for pgconnection.h - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] PATCH for pgconnection.h
Date
Msg-id 29006.931444845@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] PATCH for pgconnection.h  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] PATCH for pgconnection.h
Re: [HACKERS] PATCH for pgconnection.h
Re: [HACKERS] PATCH for pgconnection.h
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> 
>> + #ifdef __sun__
>> + #ifndef __GNUC__
>> + using namespace std;
>> + #endif
>> + #endif

The above is really, really ugly, not to say broken, because neither
being on a Sun nor using gcc have anything to do with whether your
compiler handles namespaces.  The problem we are looking at here is that
the C++ standard is a moving target, and some people have compilers that
are newer than others.

I think the proper solution is to add a configure-time test to see
whether a namespace declaration is needed.  We could use configure to
see whether we need ".h" on the end of C++ include file references, too.
(That's another thing that's going to be site-dependent for a while to
come.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] acl problem in NetBSD/m68k
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Delaying insertion of default values