+2013-12-18 Cary Coutant <ccoutant@google.com>
+
+ * configure.ac: Check for <unordered_set> and <unordered_map>.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * system.h: Use <unordered_set> and <unordered_map> if available.
+
2013-12-10 Roland McGrath <mcgrathr@google.com>
* Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the <unordered_map> header file. */
+#undef HAVE_UNORDERED_MAP
+
+/* Define to 1 if you have the <unordered_set> header file. */
+#undef HAVE_UNORDERED_SET
+
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+for ac_header in unordered_set unordered_map
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
for ac_header in tr1/unordered_set tr1/unordered_map
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
AC_LANG_PUSH(C++)
+AC_CHECK_HEADERS(unordered_set unordered_map)
AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
AC_CHECK_HEADERS(byteswap.h)
// Figure out how to get a hash set and a hash map.
-#if defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \
- && defined(HAVE_TR1_UNORDERED_MAP_REHASH)
+#if defined(HAVE_UNORDERED_SET) && defined(HAVE_UNORDERED_MAP)
+
+#include <unordered_set>
+#include <unordered_map>
+
+// We need a template typedef here.
+
+#define Unordered_set std::unordered_set
+#define Unordered_map std::unordered_map
+#define Unordered_multimap std::unordered_multimap
+
+#define reserve_unordered_map(map, n) ((map)->rehash(n))
+
+#elif defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \
+ && defined(HAVE_TR1_UNORDERED_MAP_REHASH)
#include <tr1/unordered_set>
#include <tr1/unordered_map>