3 dnl Copyright (C) 2003, 2007-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.
9 dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
10 dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
11 dnl Prerequisite: AC_PROG_CC
13 AC_DEFUN([gt_TYPE_WINT_T],
15 AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
19 wint_t foo = (wchar_t)'\0';]],
22 [gt_cv_c_wint_t=no])])
23 if test $gt_cv_c_wint_t = yes; then
24 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
26 dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
27 dnl override 'wint_t'.
28 AC_CACHE_CHECK([whether wint_t is large enough],
29 [gl_cv_type_wint_t_large_enough],
33 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
35 [gl_cv_type_wint_t_large_enough=yes],
36 [gl_cv_type_wint_t_large_enough=no])])
37 if test $gl_cv_type_wint_t_large_enough = no; then
38 GNULIBHEADERS_OVERRIDE_WINT_T=1
40 GNULIBHEADERS_OVERRIDE_WINT_T=0
43 GNULIBHEADERS_OVERRIDE_WINT_T=0
45 AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T])
48 dnl Prerequisites of the 'wint_t' override.
49 AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
51 AC_CHECK_HEADERS_ONCE([crtdefs.h])
52 if test $ac_cv_header_crtdefs_h = yes; then
57 AC_SUBST([HAVE_CRTDEFS_H])