3 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_WCSTOK],
10 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
11 AC_REQUIRE([AC_CANONICAL_HOST])
12 AC_CHECK_FUNCS_ONCE([wcstok])
13 if test $ac_cv_func_wcstok = yes; then
14 dnl On HP-UX 11.31, it depends on the compiler and linker whether wcstok()
15 dnl uses hidden state, ignoring the third argument, and thus exhibits a
16 dnl bug when two or more wcstok() iteration loops are being performed in
23 dnl POSIX: wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **);
24 dnl mingw, MSVC: wchar_t *wcstok (wchar_t *, const wchar_t *);
25 AC_CACHE_CHECK([for wcstok with POSIX signature],
26 [gl_cv_func_wcstok_posix_signature],
30 wchar_t *wcstok (wchar_t *, const wchar_t *, wchar_t **);
33 [gl_cv_func_wcstok_posix_signature=yes],
34 [gl_cv_func_wcstok_posix_signature=no])
36 if test $gl_cv_func_wcstok_posix_signature = no; then