monotone

monotone Mtn Source Tree

Root/m4/tr1unorderedmap.m4

1dnl @synopsis AC_CXX_TR1_UNORDERED_MAP
2dnl
3dnl tests for the presence of C++ TR1 unordered_map and relatives.
4dnl
5dnl @author Zack Weinberg <zackw@panix.com
6dnl @version 2006-07-23
7dnl @license AllPermissive
8
9AC_DEFUN([AC_CXX_TR1_UNORDERED_MAP],
10[AC_LANG_ASSERT([C++])
11 AC_CACHE_CHECK([whether the compiler supports tr1::unordered_map],
12 ac_cv_cxx_tr1_unordered_map_and_set,
13 [AC_COMPILE_IFELSE(AC_LANG_SOURCE([
14 #include <tr1/functional>
15 #include <tr1/unordered_map>
16 #include <tr1/unordered_set>
17 using std::tr1::hash;
18 using std::tr1::unordered_map;
19 using std::tr1::unordered_set;
20 using std::tr1::unordered_multimap;
21 ]),
22 ac_cv_cxx_tr1_unordered_map_and_set=yes,
23 ac_cv_cxx_tr1_unordered_map_and_set=no)])
24 if test x$ac_cv_cxx_tr1_unordered_map_and_set = xyes; then
25 AC_DEFINE(HAVE_TR1_UNORDERED_MAP_AND_SET, 1,
26 [Define to 1 if your C++ compiler provides
27 tr1::unordered_map and tr1::unordered_set.])
28 fi
29])
30
31dnl @synopsis AC_CXX_TR1_UNORDERED_MAP_CONST_CORRECT
32dnl
33dnl checks for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23053
34dnl
35dnl @author Nathaniel Smith <njs@pobox.com>
36dnl @version 2006-07-27
37
38AC_DEFUN([AC_CXX_TR1_UNORDERED_MAP_CONST_CORRECT],
39[AC_LANG_ASSERT([C++])
40 AC_CACHE_CHECK([for early 4.0-series g++ bug in tr1 hashtables],
41 ac_cv_cxx_tr1_hashtable_bug,
42 [
43 AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
44 [#include <tr1/unordered_set>],
45 [std::tr1::unordered_set<int> s;
46 const std::tr1::unordered_set<int> &s_ref = s;
47 s_ref.find(27);]),
48 [ac_cv_cxx_tr1_hashtable_bug=no],
49 [ac_cv_cxx_tr1_hashtable_bug=yes])])
50 if test x$ac_cv_cxx_tr1_hashtable_bug = xno; then
51 AC_DEFINE(HAVE_WORKING_TR1_UNORDERED_MAP_AND_SET, 1,
52 [Define if tr1::unordered_{map,set} actually work])
53 fi
54])

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status