2 dnl Copyright (C) 2008 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_BTOWC],
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
11 AC_CHECK_FUNCS_ONCE([btowc])
12 if test $ac_cv_func_btowc = no; then
16 dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
17 AC_REQUIRE([AC_PROG_CC])
18 AC_REQUIRE([gt_LOCALE_FR])
19 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
20 AC_CACHE_CHECK([whether btowc(EOF) is correct],
21 [gl_cv_func_btowc_eof],
23 dnl Initial guess, used when cross-compiling or when no suitable locale
28 irix*) gl_cv_func_btowc_eof="guessing no" ;;
29 # Guess yes otherwise.
30 *) gl_cv_func_btowc_eof="guessing yes" ;;
33 if test $LOCALE_FR != none; then
41 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
43 if (btowc (EOF) != WEOF)
48 [gl_cv_func_btowc_eof=yes],
49 [gl_cv_func_btowc_eof=no],
53 case "$gl_cv_func_btowc_eof" in
58 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
65 # Prerequisites of lib/btowc.c.
66 AC_DEFUN([gl_PREREQ_BTOWC], [