2 dnl Copyright (C) 2003, 2007-2019 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.
8 dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
9 dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
10 dnl Prerequisite: AC_PROG_CC
12 AC_DEFUN([gt_TYPE_WINT_T],
14 AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
18 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
20 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
26 wint_t foo = (wchar_t)'\0';]],
29 [gt_cv_c_wint_t=no])])
30 if test $gt_cv_c_wint_t = yes; then
31 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
33 dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
34 dnl override 'wint_t'.
35 AC_CACHE_CHECK([whether wint_t is too small],
36 [gl_cv_type_wint_t_too_small],
39 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
41 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
42 included before <wchar.h>. */
43 #if !(defined __GLIBC__ && !defined __UCLIBC__)
49 int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
51 [gl_cv_type_wint_t_too_small=no],
52 [gl_cv_type_wint_t_too_small=yes])])
53 if test $gl_cv_type_wint_t_too_small = yes; then
54 GNULIB_OVERRIDES_WINT_T=1
56 GNULIB_OVERRIDES_WINT_T=0
59 GNULIB_OVERRIDES_WINT_T=0
61 AC_SUBST([GNULIB_OVERRIDES_WINT_T])
64 dnl Prerequisites of the 'wint_t' override.
65 AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
67 AC_CHECK_HEADERS_ONCE([crtdefs.h])
68 if test $ac_cv_header_crtdefs_h = yes; then
73 AC_SUBST([HAVE_CRTDEFS_H])