diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-10 23:26:34 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-10 23:26:34 +0000 |
commit | c872177ccb7fa207d03308a7fcb218dbd5cea1be (patch) | |
tree | 519f13fd83f7d6ef8ed3dc5b817593cc8124e012 /libstdc++-v3/acinclude.m4 | |
parent | 0ea5169b00c142f18526e5cb4d4509e9d946e6ac (diff) | |
download | gcc-c872177ccb7fa207d03308a7fcb218dbd5cea1be.tar.gz |
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/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index bcfd4bb6e78..d976fd6937f 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -608,7 +608,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) @@ -1268,6 +1267,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]) @@ -1280,12 +1310,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; @@ -1303,8 +1338,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) |