You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
779 B

  1. dnl @synopsis AC_CXX_HAVE_NAMESPACES
  2. dnl
  3. dnl If the compiler can prevent names clashes using namespaces, define
  4. dnl HAVE_NAMESPACES.
  5. dnl
  6. dnl @category Cxx
  7. dnl @author Todd Veldhuizen
  8. dnl @author Luc Maisonobe <luc@spaceroots.org>
  9. dnl @version 2004-02-04
  10. dnl @license AllPermissive
  11. AC_DEFUN([AC_CXX_HAVE_NAMESPACES],
  12. [AC_CACHE_CHECK(whether the compiler implements namespaces,
  13. ac_cv_cxx_have_namespaces,
  14. [AC_LANG_SAVE
  15. AC_LANG_CPLUSPLUS
  16. AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
  17. [using namespace Outer::Inner; return i;],
  18. ac_cv_cxx_have_namespaces=yes, ac_cv_cxx_have_namespaces=no)
  19. AC_LANG_RESTORE
  20. ])
  21. if test "$ac_cv_cxx_have_namespaces" = yes; then
  22. AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
  23. fi
  24. ])