Determining libstdc++ version at compile time

Craig Rodrigues rodrigc@mediaone.net
Mon Mar 19 19:10:00 GMT 2001


On Mon, Mar 19, 2001 at 06:32:07PM -0800, Benjamin Kosnik wrote:
> 
> in c++config.h:
> 
> #define __GLIBCPP__ 20010301
> 
> > What is the preferred method of determining the libstdc++
> > version at compile time?

Hi,

I just looked for that macro and saw that it exists
on libstdc++-v3 but not on libstdc++-v2.  Is this correct?

So, my preprocessor check could go something like:

#if (defined (__GLIBCPP__) && __GLIBCPP__ >= 20010301 )
   v3 code here
#else
   v2 code here
#endif

Thanks.


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



More information about the Libstdc++ mailing list