diff --git a/configure.ac b/configure.ac index 631d16e..cd14a94 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,6 @@ AH_BOTTOM([ ]) AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) -# Uncomment this if you'll be exporting libraries (.so's) LT_INIT([disable-fast-install]) AC_SUBST(LIBTOOL_DEPS) AC_SUBST(SO_VERSION) @@ -79,51 +78,17 @@ AC_INTERLOCKED_EXCHANGE_NONVOLATILE # Figures out where hash_map and hash_set live, and what namespace they use AC_CXX_STL_HASH -# If we found tr1/unordered_map, prefer unordered_map/unordered_set to -# hash_map/hash_set. -if test "$ac_cv_cxx_have_unordered_map" = yes; then - ac_cv_cxx_hash_map_class="$ac_cv_cxx_hash_namespace::unordered_map" - ac_cv_cxx_hash_set_class="$ac_cv_cxx_hash_namespace::unordered_set" -else - ac_cv_cxx_hash_map_class="$ac_cv_cxx_hash_namespace::hash_map" - ac_cv_cxx_hash_set_class="$ac_cv_cxx_hash_namespace::hash_set" -fi - -AC_SUBST(ac_google_namespace) -AC_SUBST(ac_google_start_namespace) -AC_SUBST(ac_google_end_namespace) +AC_SUBST(ac_cv_cxx_hash_namespace) AC_SUBST(ac_cv_cxx_hash_map) AC_SUBST(ac_cv_cxx_hash_set) -AC_SUBST(ac_cv_cxx_hash_map_class) -AC_SUBST(ac_cv_cxx_hash_set_class) + if test "$ac_cv___attribute__" = "yes"; then AC_SUBST(ac_google_attribute, 1) else AC_SUBST(ac_google_attribute, 0) fi -if test "$ac_cv_type_u_int64_t" = "yes"; then - AC_SUBST(ac_cv_uint64, u_int64_t) -elif test "$ac_cv_type_uint64_t" = "yes"; then - AC_SUBST(ac_cv_uint64, uint64_t) -elif test "$ac_cv_type___int64" = "yes"; then - AC_SUBST(ac_cv_uint64, unsigned __int64) -else - AC_SUBST(ac_cv_uint64, unsigned long long) # best we can do -fi -# These are used by template_string.h.in -if test "$ac_cv_header_stdint_h" = "yes"; then - AC_SUBST(ac_cv_have_stdint_h, 1) -else - AC_SUBST(ac_cv_have_stdint_h, 0) -fi -if test "$ac_cv_header_inttypes_h" = "yes"; then - AC_SUBST(ac_cv_have_inttypes_h, 1) -else - AC_SUBST(ac_cv_have_inttypes_h, 0) -fi - -# One some systems (eg gnu/linux), the linker defines _start and +# On some systems (eg gnu/linux), the linker defines _start and # data_start to indicate the extent of the .text section. We can use # this to know strings are immutable. In the code, we make the # variables weak, just in case, but for this check, we only want to @@ -151,14 +116,6 @@ ac_windows_dllexport= AC_SUBST(ac_windows_dllexport_defines) AC_SUBST(ac_windows_dllexport) -# This will (should) never change, but we put it here so if we do need -# to change it, to avoid naming conflicts or something, it's easy to -# do in one place. -ac_htmlparser_namespace=ctemplate_htmlparser -AC_SUBST(ac_htmlparser_namespace) -AC_DEFINE_UNQUOTED(HTMLPARSER_NAMESPACE, $ac_htmlparser_namespace, - [The namespace to put the htmlparser code.]) - # Write generated configuration file, and also .h files AC_CONFIG_FILES([Makefile \ src/ctemplate/template_string.h \ diff --git a/src/ctemplate/per_expand_data.h.in b/src/ctemplate/per_expand_data.h.in index fa6c5e1..adba014 100644 --- a/src/ctemplate/per_expand_data.h.in +++ b/src/ctemplate/per_expand_data.h.in @@ -128,7 +128,7 @@ class @ac_windows_dllexport@ PerExpandData { struct DataEq { bool operator()(const char* s1, const char* s2) const; }; - typedef @ac_cv_cxx_hash_map_class@ DataMap; + typedef @ac_cv_cxx_hash_namespace@::unordered_map DataMap; const char* annotate_path_; TemplateAnnotator* annotator_; diff --git a/src/ctemplate/template_cache.h.in b/src/ctemplate/template_cache.h.in index 19b2d6d..512a8c7 100644 --- a/src/ctemplate/template_cache.h.in +++ b/src/ctemplate/template_cache.h.in @@ -34,7 +34,7 @@ #ifndef TEMPLATE_TEMPLATE_CACHE_H_ #define TEMPLATE_TEMPLATE_CACHE_H_ -#include @ac_cv_cxx_hash_map@ // for @ac_cv_cxx_hash_map_class@<> +#include @ac_cv_cxx_hash_map@ #include // for string #include // for pair #include // for vector<> @@ -278,9 +278,8 @@ class @ac_windows_dllexport@ TemplateCache { public: typedef std::pair TemplateCacheKey; private: - typedef @ac_cv_cxx_hash_map_class@ - TemplateMap; - typedef @ac_cv_cxx_hash_map_class@ TemplateCallMap; + typedef @ac_cv_cxx_hash_namespace@::unordered_map TemplateMap; + typedef @ac_cv_cxx_hash_namespace@::unordered_map TemplateCallMap; // Where to search for files. typedef std::vector TemplateSearchPath; diff --git a/src/ctemplate/template_namelist.h.in b/src/ctemplate/template_namelist.h.in index d1bf35f..a5eacd2 100644 --- a/src/ctemplate/template_namelist.h.in +++ b/src/ctemplate/template_namelist.h.in @@ -82,7 +82,7 @@ class @ac_windows_dllexport@ TemplateNamelist { // thing you should do with them is call size() and/or iterate // between begin() and end(), and the only operations we promise // the iterators will support are operator* and operator++. - typedef @ac_cv_cxx_hash_set_class@ NameListType; + typedef @ac_cv_cxx_hash_namespace@::unordered_set NameListType; typedef std::vector MissingListType; typedef std::vector SyntaxListType; diff --git a/src/ctemplate/template_string.h.in b/src/ctemplate/template_string.h.in index c67ec6f..adc286e 100644 --- a/src/ctemplate/template_string.h.in +++ b/src/ctemplate/template_string.h.in @@ -39,13 +39,7 @@ #include #include -#if @ac_cv_have_stdint_h@ -#include // one place @ac_cv_unit64@ might live -#endif -#if @ac_cv_have_inttypes_h@ -#include // another place @ac_cv_unit64@ might live -#endif -#include // final place @ac_cv_unit64@ might live +#include class TemplateStringTest; // needed for friendship declaration class StaticTemplateStringTest; @@ -130,7 +124,7 @@ struct @ac_windows_dllexport@ StaticTemplateString { } do_not_use_directly_; // This class is a good hash functor to pass in as the third - // argument to @ac_cv_cxx_hash_map_class@<>, when creating a map whose keys are + // argument to unordered_map<>, when creating a map whose keys are // StaticTemplateString. NOTE: This class isn't that safe to use, // because it requires that StaticTemplateStringInitializer has done // its job. Unfortunately, even when you use the STS_INIT macro