aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/aclocal.m4
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-10 23:26:34 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-10 23:26:34 +0000
commitc872177ccb7fa207d03308a7fcb218dbd5cea1be (patch)
tree519f13fd83f7d6ef8ed3dc5b817593cc8124e012 /libstdc++-v3/aclocal.m4
parent0ea5169b00c142f18526e5cb4d4509e9d946e6ac (diff)
2001-06-10 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_ENABLE_C99): Add stdio.h checking. Add checking for strtof, _Exit in stdlib.h * aclocal.m4: Regenerate. * configure.in: Regenerate. * include/c_std/bits/std_cstdio.h: Alphabetize lists. (snprintf): Put C99 functions into __gnu_cxx namespace. (vfscanf): Same. (vscanf): Same. (vsnprintf): Same. (vsscanf): Same. * include/c_std/bits/std_cstdlib.h: Alphabetize lists. Put undefs for C99 functions within _GLIBCPP_USE_C99 guard. (_Exit): Same. (strtof): Same. (strtold): Same. * include/bits/locale_facets.tcc: Check if C99 is enabled. * include/c_std/bits/std_cwchar.h (__gnu_cxx): Put undefs within C99 guard. * include/c_std/bits/cmath.tcc: Formatting tweak. * include/c_std/bits/std_cmath.h: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43161 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/aclocal.m4')
-rw-r--r--libstdc++-v3/aclocal.m446
1 files changed, 43 insertions, 3 deletions
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index 26eabacbc8f..f59e10a54eb 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -141,6 +141,10 @@ LIB_AC_PROG_CXX
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
AC_EXEEXT
fi
@@ -616,7 +620,6 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
- AC_CHECK_FUNCS(strtof)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
AC_CHECK_FUNCS(drand48)
@@ -1276,6 +1279,37 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
[isunordered(0.0,0.0);],, [ac_c99_math=no])
AC_MSG_RESULT($ac_c99_math)
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_MSG_RESULT($ac_c99_stdio)
+
# Check for the existence in <stdlib.h> of lldiv_t, et. al.
ac_c99_stdlib=yes;
AC_MSG_CHECKING([for lldiv_t declaration])
@@ -1288,12 +1322,17 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
[char* tmp; strtoll("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
AC_TRY_COMPILE([#include <stdlib.h>],
[char* tmp; strtoull("gnu", &tmp, 10);],, [ac_c99_stdlib=no])
AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
if test x"$ac_c99_lldiv_t" = x"no"; then
ac_c99_stdlib=no;
fi;
@@ -1311,8 +1350,9 @@ AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
AC_MSG_RESULT($ac_c99_wchar)
AC_MSG_CHECKING([for enabled ISO C99 support])
- if test x"$ac_c99_math" = x"no" || test x"$ac_c99_wchar" = x"no" \
- || test x"$ac_c99_stdlib" = x"no"; then
+ if test x"$ac_c99_math" = x"no" || test x"$ac_c99_stdio" = x"no" \
+ || test x"$ac_c99_stdlib" = x"no" \
+ || test x"$ac_c99_wchar" = x"no"; then
enable_c99=no;
fi;
AC_MSG_RESULT($enable_c99)