Mercurial > hg > octave-lojdl > gnulib-hg
annotate m4/wctype_h.m4 @ 15308:a3ba680ad389
strerror_r: fix OpenBSD behavior on 0
OpenBSD treats strerror_r(0,,) as a success, but with a message
"Undefined error: 0"; while this is distinct from strerror_r(-1,,)
returning "Unknown error: -1", it does not imply success. Meanwhile,
if buf is short enough for ERANGE, then we can't use strstr to look
for "Unknown" or "Undefined" in the resulting message, like we had
been doing for strerror(). Fix this by shifting the burden - now
the strerror-override code guarantees that 0 will have an
override when needed.
* lib/strerror-override.c (strerror_override): Also override 0
when needed.
* lib/strerror-override.h (strerror_override): Likewise.
* lib/strerror.c (strerror): Simplify, now that 0 override is done
earlier.
* lib/strerror_r.c (strerror_r): Likewise.
* m4/strerror.m4 (gl_FUNC_STRERROR): Split detection of 0
behavior...
(gl_FUNC_STRERROR_0): ...into new macro.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Replace strerror_r if 0
is overridden.
(gl_FUNC_STRERROR_R_WORKS): Avoid extra tests if 0 is broken.
* modules/strerror-override (Files): Add strerror.m4.
(configure.ac): Also provide override for 0 when needed.
* doc/posix-functions/strerror.texi (strerror): Document this.
* doc/posix-functions/perror.texi (perror): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 21 Jun 2011 08:50:51 -0600 |
parents | 4d31d731ac62 |
children | fe7627541c17 |
rev | line source |
---|---|
14318
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
1 # wctype_h.m4 serial 14 |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
14020
diff
changeset
|
5 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 dnl This file is free software; the Free Software Foundation |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 dnl gives unlimited permission to copy and/or distribute it, |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 dnl with or without modifications, as long as this notice is preserved. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 dnl Written by Paul Eggert. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 AC_DEFUN([gl_WCTYPE_H], |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 [ |
14310 | 14 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 AC_REQUIRE([AC_PROG_CC]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 AC_REQUIRE([AC_CANONICAL_HOST]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 AC_CHECK_FUNCS_ONCE([iswcntrl]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 if test $ac_cv_func_iswcntrl = yes; then |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 HAVE_ISWCNTRL=1 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 else |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 HAVE_ISWCNTRL=0 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 fi |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 AC_SUBST([HAVE_ISWCNTRL]) |
13618
c28f6dd5002f
wctype: Avoid compilation error on IRIX 6.5.30.
Bruno Haible <bruno@clisp.org>
parents:
13009
diff
changeset
|
24 |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 AC_REQUIRE([AC_C_INLINE]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 AC_REQUIRE([gt_TYPE_WINT_T]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 if test $gt_cv_c_wint_t = yes; then |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 HAVE_WINT_T=1 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 else |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 HAVE_WINT_T=0 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 fi |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 AC_SUBST([HAVE_WINT_T]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 |
14213
201402d33253
wctype: Ensure valid C syntax.
Bruno Haible <bruno@clisp.org>
parents:
14211
diff
changeset
|
35 gl_CHECK_NEXT_HEADERS([wctype.h]) |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 if test $ac_cv_header_wctype_h = yes; then |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 if test $ac_cv_func_iswcntrl = yes; then |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 dnl Linux libc5 has an iswprint function that returns 0 for all arguments. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 dnl The other functions are likely broken in the same way. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 [ |
14020
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
42 AC_RUN_IFELSE( |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
43 [AC_LANG_SOURCE([[ |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
44 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
45 included before <wchar.h>. |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
46 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
47 must be included before <wchar.h>. */ |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
48 #include <stddef.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
49 #include <stdio.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
50 #include <time.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
51 #include <wchar.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
52 #include <wctype.h> |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
53 int main () { return iswprint ('x') == 0; } |
318a4063e921
Ensure all prerequisites of <wchar.h> are included.
Bruno Haible <bruno@clisp.org>
parents:
13958
diff
changeset
|
54 ]])], |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 #if __GNU_LIBRARY__ == 1 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
58 Linux libc5 i18n is broken. |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
59 #endif]], [])], |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
61 ]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
62 ]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 fi |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
64 HAVE_WCTYPE_H=1 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
65 else |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 HAVE_WCTYPE_H=0 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 fi |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 AC_SUBST([HAVE_WCTYPE_H]) |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 if test "$gl_cv_func_iswcntrl_works" = no; then |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
71 REPLACE_ISWCNTRL=1 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
72 else |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
73 REPLACE_ISWCNTRL=0 |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
74 fi |
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
75 AC_SUBST([REPLACE_ISWCNTRL]) |
13958
eaaa26453720
wctype: Make it work in C++ mode on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13620
diff
changeset
|
76 |
eaaa26453720
wctype: Make it work in C++ mode on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13620
diff
changeset
|
77 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then |
eaaa26453720
wctype: Make it work in C++ mode on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13620
diff
changeset
|
78 dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>. |
eaaa26453720
wctype: Make it work in C++ mode on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13620
diff
changeset
|
79 : |
eaaa26453720
wctype: Make it work in C++ mode on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13620
diff
changeset
|
80 fi |
14318
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
81 |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
82 dnl We assume that the wctype() and iswctype() functions exist if and only |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
83 dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
84 dnl exists. |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
85 dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>. |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
86 AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
87 [AC_COMPILE_IFELSE( |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
88 [AC_LANG_PROGRAM( |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
89 [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
90 included before <wchar.h>. |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
91 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
92 must be included before <wchar.h>. */ |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
93 #include <stddef.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
94 #include <stdio.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
95 #include <time.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
96 #include <wchar.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
97 #if HAVE_WCTYPE_H |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
98 # include <wctype.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
99 #endif |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
100 wctype_t a; |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
101 ]], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
102 [[]])], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
103 [gl_cv_type_wctype_t=yes], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
104 [gl_cv_type_wctype_t=no]) |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
105 ]) |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
106 if test $gl_cv_type_wctype_t = no; then |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
107 HAVE_WCTYPE_T=0 |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
108 fi |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
109 |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
110 dnl We assume that the wctrans() and towctrans() functions exist if and only |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
111 dnl if the type wctrans_t is defined in <wctype.h>. |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
112 AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
113 [AC_COMPILE_IFELSE( |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
114 [AC_LANG_PROGRAM( |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
115 [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
116 included before <wchar.h>. |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
117 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
118 must be included before <wchar.h>. */ |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
119 #include <stddef.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
120 #include <stdio.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
121 #include <time.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
122 #include <wchar.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
123 #include <wctype.h> |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
124 wctrans_t a; |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
125 ]], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
126 [[]])], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
127 [gl_cv_type_wctrans_t=yes], |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
128 [gl_cv_type_wctrans_t=no]) |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
129 ]) |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
130 if test $gl_cv_type_wctrans_t = no; then |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
131 HAVE_WCTRANS_T=0 |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
132 fi |
14319 | 133 |
134 dnl Check for declarations of anything we want to poison if the | |
135 dnl corresponding gnulib module is not in use. | |
136 gl_WARN_ON_USE_PREPARE([[ | |
137 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
138 <wchar.h>. | |
139 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
140 included before <wchar.h>. */ | |
141 #if !(defined __GLIBC__ && !defined __UCLIBC__) | |
142 # include <stddef.h> | |
143 # include <stdio.h> | |
144 # include <time.h> | |
145 # include <wchar.h> | |
146 #endif | |
147 #include <wctype.h> | |
148 ]], | |
14322 | 149 [wctype iswctype wctrans towctrans |
14319 | 150 ]) |
12914
7031f1066ded
More consistent naming of *.m4 files.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 ]) |
14310 | 152 |
153 AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], | |
154 [ | |
155 dnl Use AC_REQUIRE here, so that the default settings are expanded once only. | |
156 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) | |
157 gl_MODULE_INDICATOR_SET_VARIABLE([$1]) | |
158 dnl Define it also as a C macro, for the benefit of the unit tests. | |
159 gl_MODULE_INDICATOR_FOR_TESTS([$1]) | |
160 ]) | |
161 | |
162 AC_DEFUN([gl_WCTYPE_H_DEFAULTS], | |
163 [ | |
164 GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) | |
14319 | 165 GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) |
14320 | 166 GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) |
14321 | 167 GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) |
14322 | 168 GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) |
14310 | 169 dnl Assume proper GNU behavior unless another module says otherwise. |
170 HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) | |
14318
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
171 HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) |
18ad0b0246fc
wctype-h: Ensure wctype_t and wctrans_t are defined.
Bruno Haible <bruno@clisp.org>
parents:
14310
diff
changeset
|
172 HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) |
14310 | 173 REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) |
174 ]) |