File: ac_cxx_have_long_long_for_iostream.m4

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (52 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
dnl @synopsis AC_CXX_HAVE_LONG_LONG_FOR_IOSTREAM
dnl
dnl Check if the compiler allow long long for [i|o]stream Seems that
dnl OpenBSD / gcc-3 don't have it.
dnl
dnl Eg:
dnl
dnl   #include <iostream>
dnl   #ifdef HAVE_SSTREAM
dnl   #include <strstream>
dnl   #else
dnl   #include <sstream>
dnl   #endif
dnl   #ifdef HAVE_NAMESPACES
dnl   using namespace std;
dnl   #endif
dnl   ostream str((streambuf *)0);
dnl   long long lo=1;
dnl   str <<
dnl   #ifdef HAVE_LONG_LONG_FOR_IOSTREAM
dnl     (long int)
dnl   #endif
dnl           lo;
dnl
dnl @category Cxx
dnl @author Alain BARBET <alian@cpan.org>
dnl @version 2002-09-04
dnl @license GPLWithACException

AC_DEFUN([AC_CXX_HAVE_LONG_LONG_FOR_IOSTREAM],
[AC_CACHE_CHECK(whether the compiler allow long long for [i|o]stream,
ac_cv_cxx_have_ll_for_iostream,
[AC_REQUIRE([AC_CXX_NAMESPACES])
  AC_REQUIRE([AC_CXX_HAVE_SSTREAM])
  AC_LANG_SAVE
  AC_LANG_CPLUSPLUS
  AC_TRY_COMPILE([#include <iostream>
#ifdef HAVE_SSTREAM
#include <strstream>
#else
#include <sstream>
#endif
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[ ostream str((streambuf *)0); long long l=1; str << l; return 0;],
  ac_cv_cxx_have_ll_for_iostream=yes, ac_cv_cxx_have_ll_for_iostream=no)
  AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_ll_for_iostream" = yes; then
   AC_DEFINE(HAVE_LONG_LONG_FOR_IOSTREAM,,[define if the compiler allow long long for [i|o]stream])
fi
])