From 0301639b8403acdd80e69dbbe508aef330ad0c67 Mon Sep 17 00:00:00 2001 From: zeekec Date: Wed, 22 Feb 2006 02:10:28 +0000 Subject: [PATCH] Moved the requires, header check, and language save and restore outside of the cache check. --- config/ac_cxx_have_sstream.m4 | 15 ++++++++------- config/ac_cxx_have_strstream.m4 | 9 ++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/ac_cxx_have_sstream.m4 b/config/ac_cxx_have_sstream.m4 index ddcf4b6..677f778 100644 --- a/config/ac_cxx_have_sstream.m4 +++ b/config/ac_cxx_have_sstream.m4 @@ -3,22 +3,23 @@ dnl dnl If the C++ library has a working stringstream, define HAVE_SSTREAM. dnl dnl @author Ben Stanley -dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2003/03/19 02:40:00 mes5k Exp $ +dnl @version $Id: ac_cxx_have_sstream.m4,v 1.2 2006/02/22 02:10:28 zeekec Exp $ dnl AC_DEFUN([AC_CXX_HAVE_SSTREAM], -[AC_CACHE_CHECK(whether the compiler has stringstream, -ac_cv_cxx_have_sstream, [AC_REQUIRE([AC_CXX_NAMESPACES]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(sstream) +AC_CACHE_CHECK([whether the STL defines stringstream], +[ac_cv_cxx_have_sstream], +[AC_TRY_COMPILE([#include #ifdef HAVE_NAMESPACES using namespace std; #endif],[stringstream message; message << "Hello"; return 0;], ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no) - AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_sstream" = yes; then AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream]) fi +AC_LANG_RESTORE ]) diff --git a/config/ac_cxx_have_strstream.m4 b/config/ac_cxx_have_strstream.m4 index 232a3d6..1b811d1 100644 --- a/config/ac_cxx_have_strstream.m4 +++ b/config/ac_cxx_have_strstream.m4 @@ -5,14 +5,13 @@ dnl dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins dnl AC_DEFUN([AC_CXX_HAVE_STRSTREAM], -[AC_CACHE_CHECK(whether the library defines class strstream, -ac_cv_cxx_have_class_strstream, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(strstream) - AC_TRY_COMPILE([ -#if HAVE_STRSTREAM + AC_CACHE_CHECK([whether the STL defines strstream], +[ac_cv_cxx_have_class_strstream], +[AC_TRY_COMPILE([#if HAVE_STRSTREAM # include #else # include @@ -21,9 +20,9 @@ ac_cv_cxx_have_class_strstream, using namespace std; #endif],[ostrstream message; message << "Hello"; return 0;], ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no) - AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_class_strstream" = yes; then AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream]) fi +AC_LANG_RESTORE ])