diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2010-01-07 04:40:54 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2010-01-07 04:40:54 +0000 |
commit | 83aba29ebee2bb0885ab2db04b3ad6b22463fe58 (patch) | |
tree | 60531ab8e335ef5819c5b8f1848b14c37278f873 | |
parent | 2773bdf23930c9d802d804100eb20e305cf8b280 (diff) | |
download | protobuf-83aba29ebee2bb0885ab2db04b3ad6b22463fe58.tar.gz protobuf-83aba29ebee2bb0885ab2db04b3ad6b22463fe58.tar.bz2 protobuf-83aba29ebee2bb0885ab2db04b3ad6b22463fe58.zip |
Detect and avoid broken unordered_map on OSX 10.5 / GCC 4.0.1.
-rw-r--r-- | m4/stl_hash.m4 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/m4/stl_hash.m4 b/m4/stl_hash.m4 index 84765a28..08813c99 100644 --- a/m4/stl_hash.m4 +++ b/m4/stl_hash.m4 @@ -22,8 +22,14 @@ AC_DEFUN([AC_CXX_STL_HASH], if test -z "$ac_cv_cxx_hash_map_header"; then + # On OSX 1.5 / GCC 4.0.1 (the standard compiler on that platform), + # calling find() on a const unordered_map does not compile. So, we + # include a call to find() in our test to detect this broken + # implementation and avoid using it. Note that ext/hash_map works + # fine on this platform, so we'll end up using that. AC_TRY_COMPILE([#include <$location>], - [${namespace}::$name<int, int> t], + [const ${namespace}::$name<int, int> t; + t.find(1);], [ac_cv_cxx_hash_map_header="<$location>"; ac_cv_cxx_hash_namespace="$namespace"; ac_cv_cxx_hash_map_class="$name";]) |