blob: 756e378f7f78733beffbb56bfea2f6a12c6bc67e [file] [log] [blame]
Reid Spencer491f6812004-09-07 06:56:14 +00001# Check for C++ namespace support. This is from
2# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
3#
4AC_DEFUN([AC_CXX_NAMESPACES],
5[AC_CACHE_CHECK(whether the compiler implements namespaces,
6ac_cv_cxx_namespaces,
7[AC_LANG_SAVE
8 AC_LANG_CPLUSPLUS
9 AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
10 [using namespace Outer::Inner; return i;],
11 ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
12 AC_LANG_RESTORE
13])
14if test "$ac_cv_cxx_namespaces" = yes; then
15 AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
16fi
17])
18