cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | dnl @synopsis AC_CXX_HAVE_STD_NAMESPACE |
| 2 | dnl |
| 3 | dnl If the compiler supports the std namespace, define |
| 4 | dnl HAVE_STD_NAMESPACE. |
| 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 | |
| 12 | AC_DEFUN([AC_CXX_HAVE_STD_NAMESPACE], |
| 13 | [AC_CACHE_CHECK(whether the compiler supports the std namespace, |
| 14 | ac_cv_cxx_have_std_namespace, |
| 15 | [AC_LANG_SAVE |
| 16 | AC_LANG_CPLUSPLUS |
| 17 | AC_TRY_COMPILE([#include <iostream> |
| 18 | std::istream& is = std::cin; |
| 19 | ],[return 0;], |
| 20 | ac_cv_cxx_have_std_namespace=yes, ac_cv_cxx_have_std_namespace=no) |
| 21 | AC_LANG_RESTORE |
| 22 | ]) |
| 23 | if test "$ac_cv_cxx_have_std_namespace" = yes; then |
| 24 | AC_DEFINE(HAVE_STD_NAMESPACE,,[define if the compiler supports the std namespace]) |
| 25 | fi |
| 26 | ]) |