瀏覽代碼

Merge pull request #766 from pkasting/hash

Refine check for unordered_{map|set} availability.
Feng Xiao 10 年之前
父節點
當前提交
c8c5fed544
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/google/protobuf/stubs/hash.h

+ 4 - 4
src/google/protobuf/stubs/hash.h

@@ -41,10 +41,10 @@
 #define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1
 #define GOOGLE_PROTOBUF_HAVE_HASH_SET 1
 
-// Use C++11 unordered_{map|set} if available. Otherwise, libc++ always support
-// unordered_{map|set}
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X) || \
-    defined(_LIBCPP_VERSION)
+// Use C++11 unordered_{map|set} if available.
+#if ((_LIBCPP_STD_VER >= 11) || \
+     (((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \
+      (__GLIBCXX__ > 20090421)))
 # define GOOGLE_PROTOBUF_HAS_CXX11_HASH
 
 // For XCode >= 4.6:  the compiler is clang with libc++.