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

Rich E reakinator at gmail.com
Sat Jul 21 13:46:26 PDT 2012


Thank you everyone for the great suggestions.  After some consideration I
think I'll just include boost/config.hpp, and look for _LIBCPP_VERSION,
since it is already included elsewhere.

It appears that boost is also using Howard's method exactly
(boost/config/stdlib/libcpp.hpp), wonder why that is. :)

#if __has_include(<thread>)
>   #include <thread> // and assume libc++ or any other c++11 compliant
> library
> #endif


I was doing this for a while, but I decided it was cluttering up the
includes section since you also need a check for __clang__

cheers,
Rich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120721/2899a3ea/attachment.html>


More information about the cfe-dev mailing list