Import fmit upstream version 0.97.6
[fmit.git] / m4 / ac_cxx_have_sstream.m4
1 dnl @synopsis AC_CXX_HAVE_SSTREAM
2 dnl
3 dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
4 dnl
5 dnl @author Ben Stanley
6 dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $
7 dnl
8 AC_DEFUN([AC_CXX_HAVE_SSTREAM],
9 [AC_CACHE_CHECK(whether the compiler has stringstream,
10 ac_cv_cxx_have_sstream,
11 [AC_REQUIRE([AC_CXX_NAMESPACES])
12  AC_LANG_SAVE
13  AC_LANG_CPLUSPLUS
14  AC_TRY_COMPILE([#include <sstream>
15 #ifdef HAVE_NAMESPACES
16 using namespace std;
17 #endif],[stringstream message; message << "Hello"; return 0;],
18  ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
19  AC_LANG_RESTORE
20 ])
21 if test "$ac_cv_cxx_have_sstream" = yes; then
22   AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream])
23 fi
24 ])