Commit 5ea84dd3 authored by Peter Kasting's avatar Peter Kasting

Refine check for unordered_{map|set} availability.

It's not enough to check for C++11 language support, as it's possible for
projects to enable C++11 language and library features independently (e.g.
Chromium currently does this).  Instead, explicitly check the library version to
see if it is recent enough to include unordered_{map|set}.
parent 47210ccd
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
#define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1 #define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1
#define GOOGLE_PROTOBUF_HAVE_HASH_SET 1 #define GOOGLE_PROTOBUF_HAVE_HASH_SET 1
// Use C++11 unordered_{map|set} if available. Otherwise, libc++ always support // Use C++11 unordered_{map|set} if available.
// unordered_{map|set} #if ((__cplusplus >= 201103L) && \
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X) || \ ((defined(__GLIBCXX__) && (__GLIBCXX__ > 20090421)) || \
defined(_LIBCPP_VERSION) (defined(_LIBCPP_VERSION) && (_LIBCPP_STD_VER >= 11))))
# define GOOGLE_PROTOBUF_HAS_CXX11_HASH # define GOOGLE_PROTOBUF_HAS_CXX11_HASH
// For XCode >= 4.6: the compiler is clang with libc++. // For XCode >= 4.6: the compiler is clang with libc++.
......
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