1 dnl Copyright (C) 2009 Nick Bowler
2 dnl Copying and distribution of this file, with or without modification,
3 dnl are permitted in any medium without royalty provided the copyright
4 dnl notice and this notice are preserved. This file is offered as-is,
5 dnl without any warranty.
7 m4_pattern_forbid([^_?CSTD_[A-Z_]+$])
9 m4_define([_CSTD_WCHAR_T_UCHAR_PROG], [AC_LANG_PROGRAM([dnl
14 #if WCHAR_MAX < UCHAR_MAX
15 # error wchar_t cannot represent all unsigned char values.
16 #elif WEOF >= 0 && WEOF <= UCHAR_MAX
17 # error WEOF value conflicts with unsigned char.
21 AC_DEFUN([CSTD_WCHAR_T_UCHAR], [dnl
22 AC_CACHE_CHECK([if wchar_t can represent all unsigned char values],
23 [cstd_cv_wchar_t_uchar],
24 [AC_COMPILE_IFELSE([_CSTD_WCHAR_T_UCHAR_PROG],
25 [cstd_cv_wchar_t_uchar=yes], [cstd_cv_wchar_t_uchar=no])])