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]

Determining libstdc++ version at compile time


Hi,

I'm looking at maintaining a piece of code which uses
some low-level functions in the libstdc++-v2 iostreams
implementation, and need to keep that code portable
between v2 and v3.

What is the preferred method of determining the libstdc++
version at compile time?

Someone recommended to me that using some preprocessor macro
logic like:

#if ( defined(__GNUC__) && defined(_CPP_STREAMBUF) )
    v3 specific iostreams code here
#else
    v2 specific iostreams code here
#endif

I don't like relying on the _CPP_STREAMBUF macro.
Is there another macro which can tell me the version of 
the libstdc++ library instead?

Thanks.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


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