File: ac_cxx_have_strstream.m4

package info (click to toggle)
cppunit 1.13.2-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,980 kB
  • ctags: 3,579
  • sloc: cpp: 18,338; sh: 14,983; ansic: 3,011; makefile: 423; xml: 58; csh: 6
file content (29 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
dnl @synopsis AC_CXX_HAVE_STRSTREAM
dnl
dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM.
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
#  include <strstream>
#else
#  include <strstream.h>
#endif
#ifdef HAVE_NAMESPACES
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
])