2 dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_WCSTOK],
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 AC_CHECK_FUNCS_ONCE([wcstok])
12 if test $ac_cv_func_wcstok = yes; then
13 dnl On HP-UX 11.31, it depends on the compiler and linker whether wcstok()
14 dnl uses hidden state, ignoring the third argument, and thus exhibits a
15 dnl bug when two or more wcstok() iteration loops are being performed in
22 dnl POSIX: wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **);
23 dnl mingw, MSVC: wchar_t *wcstok (wchar_t *, const wchar_t *);
24 AC_CACHE_CHECK([for wcstok with POSIX signature],
25 [gl_cv_func_wcstok_posix_signature],
29 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
31 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
32 included before <wchar.h>. */
37 wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **);
40 [gl_cv_func_wcstok_posix_signature=yes],
41 [gl_cv_func_wcstok_posix_signature=no])
43 if test $gl_cv_func_wcstok_posix_signature = no; then