- # Check for the existence of <wchar.h> functions used if C99 is enabled.
- # XXX the wchar.h checks should be rolled into the general C99 bits.
- ac_c99_wchar=yes;
- AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_MSG_RESULT($ac_c99_wchar)
+ # Check for the existence in <wchar.h> of wcstoull, WEOF, etc.
+ AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
+ ac_c99_wchar=no;
+ if test x"$ac_has_wchar_h" = xyes &&
+ test x"$ac_has_wctype_h" = xyes; then
+ AC_TRY_COMPILE([#include <wchar.h>
+ #include <stddef.h>
+ wint_t i;
+ long l = WEOF;
+ long j = WCHAR_MIN;
+ long k = WCHAR_MAX;
+ namespace test
+ {
+ using ::btowc;
+ using ::fgetwc;
+ using ::fgetws;
+ using ::fputwc;
+ using ::fputws;
+ using ::fwide;
+ using ::fwprintf;
+ using ::fwscanf;
+ using ::getwc;
+ using ::getwchar;
+ using ::mbrlen;
+ using ::mbrtowc;
+ using ::mbsinit;
+ using ::mbsrtowcs;
+ using ::putwc;
+ using ::putwchar;
+ using ::swprintf;
+ using ::swscanf;
+ using ::ungetwc;
+ using ::vfwprintf;
+ using ::vswprintf;
+ using ::vwprintf;
+ using ::wcrtomb;
+ using ::wcscat;
+ using ::wcschr;
+ using ::wcscmp;
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
+ using ::wcsftime;
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+ using ::wcsncpy;
+ using ::wcspbrk;
+ using ::wcsrchr;
+ using ::wcsrtombs;
+ using ::wcsspn;
+ using ::wcsstr;
+ using ::wcstod;
+ using ::wcstok;
+ using ::wcstol;
+ using ::wcstold;
+ using ::wcstoll;
+ using ::wcstoul;
+ using ::wcstoull;
+ using ::wcsxfrm;
+ using ::wctob;
+ using ::wmemchr;
+ using ::wmemcmp;
+ using ::wmemcpy;
+ using ::wmemmove;
+ using ::wmemset;
+ using ::wprintf;
+ using ::wscanf;
+ }
+ ],[],[ac_c99_wchar=yes], [ac_c99_wchar=no])
+
+ # Checks for wide character functions that may not be present.
+ # Injection of these is wrapped with guard macros.
+ # NB: only put functions here, instead of immediately above, if
+ # absolutely necessary.
+ AC_TRY_COMPILE([#include <wchar.h>
+ namespace test { using ::vfwscanf; } ], [],
+ [AC_DEFINE(HAVE_VFWSCANF,1,
+ [Defined if vfwscanf exists.])],[])
+
+ AC_TRY_COMPILE([#include <wchar.h>
+ namespace test { using ::vswscanf; } ], [],
+ [AC_DEFINE(HAVE_VSWSCANF,1,
+ [Defined if vswscanf exists.])],[])
+
+ AC_TRY_COMPILE([#include <wchar.h>
+ namespace test { using ::vwscanf; } ], [],
+ [AC_DEFINE(HAVE_VWSCANF,1,[Defined if vwscanf exists.])],[])
+
+ AC_TRY_COMPILE([#include <wchar.h>
+ namespace test { using ::wcstof; } ], [],
+ [AC_DEFINE(HAVE_WCSTOF,1,[Defined if wcstof exists.])],[])
+
+ AC_TRY_COMPILE([#include <wctype.h>],
+ [ wint_t t; int i = iswblank(t);],
+ [AC_DEFINE(HAVE_ISWBLANK,1,
+ [Defined if iswblank exists.])],[])
+
+ AC_MSG_CHECKING([for ISO C99 support in <wchar.h>])
+ AC_MSG_RESULT($ac_c99_wchar)
+ fi