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

Rich E reakinator at gmail.com
Thu Jul 19 19:19:16 PDT 2012


Hi all,

I am enabling libc++ in a library that was depending on boost for things
such as mutex, thread, shared_ptr, etc., and 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. This include is used to determine which standard library we should use,
and many things depend on it. Is there a better solution, other than a -D
flag to clang?

Cheers,
Rich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120719/d510157e/attachment.html>


More information about the cfe-dev mailing list