Commit c9cb9d57 authored by Kenton Varda's avatar Kenton Varda

Print warning on OSX when using old libstdc++ (rather than libc++).

parent 3d464e05
......@@ -30,6 +30,7 @@
#ifndef KJ_COMMON_H_
#define KJ_COMMON_H_
#ifndef KJ_NO_COMPILER_CHECK
#if __cplusplus < 201103L && !__CDT_PARSER__
#error "This code requires C++11. Either your compiler does not support it or it is not enabled."
#ifdef __GNUC__
......@@ -47,6 +48,10 @@
"version 4.2 (wat?), is actually built from some random SVN revision between 3.1 "\
"and 3.2. Unfortunately, it is insufficient for compiling this library. You can "\
"download the real Clang 3.2 (or newer) from the Clang web site."
#elif __cplusplus >= 201103L && !__has_include(<initializer_list>)
#warning "Your compiler supports C++11 but your C++ standard library does not. If your "\
"system has libc++ installed (as should be the case on e.g. Mac OSX), try adding "\
"-stdlib=libc++ to your CXXFLAGS."
#endif
#else
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
......@@ -55,6 +60,11 @@
#endif
#elif defined(_MSC_VER)
#warning "As of June 2013, Visual Studio's C++11 support was hopelessly behind what is needed to compile this code."
#else
#warning "I don't recognize your compiler. As of this writing, Clang and GCC are the only "\
"known compilers with enough C++11 support for this library. "\
"#define KJ_NO_COMPILER_CHECK to make this warning go away."
#endif
#endif
// =======================================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment