stl_namespace.m4 917 B

12345678910111213141516171819202122232425
  1. # We check what namespace stl code like vector expects to be executed in
  2. AC_DEFUN([AC_CXX_STL_NAMESPACE],
  3. [AC_CACHE_CHECK(
  4. what namespace STL code is in,
  5. ac_cv_cxx_stl_namespace,
  6. [AC_REQUIRE([AC_CXX_NAMESPACES])
  7. AC_LANG_SAVE
  8. AC_LANG_CPLUSPLUS
  9. AC_TRY_COMPILE([#include <vector>],
  10. [vector<int> t; return 0;],
  11. ac_cv_cxx_stl_namespace=none)
  12. AC_TRY_COMPILE([#include <vector>],
  13. [std::vector<int> t; return 0;],
  14. ac_cv_cxx_stl_namespace=std)
  15. AC_LANG_RESTORE])
  16. if test "$ac_cv_cxx_stl_namespace" = none; then
  17. AC_DEFINE(STL_NAMESPACE,,
  18. [the namespace where STL code like vector<> is defined])
  19. fi
  20. if test "$ac_cv_cxx_stl_namespace" = std; then
  21. AC_DEFINE(STL_NAMESPACE,std,
  22. [the namespace where STL code like vector<> is defined])
  23. fi
  24. ])