[cfe-dev] Best way to detect libc++ at compile time?

Michel Morin mimomorin at gmail.com
Thu Jul 19 19:54:39 PDT 2012


Rich E wrote:
> I have not yet found a way to
> detect that we are compiling with the libc++ library unless I first include
> a header from it.  I can do this:
>
> // framework config.h:
>
> #include <vector>
>
> #if defined( _LIBCPP_VERSION )
>     #define USING_LIBCPP
> #endif
>
> but now every file that wanted to know if we are using libc++ has vector in
> it.

FYI, Boost.Config (boost/config/select_stdlib_config.hpp) determines the
standard library by including <cstddef> and checking vendor-specific macros.


Regards,
Michel



More information about the cfe-dev mailing list