annotate m4/wchar.m4 @ 10932:4d1763d8867c

New module 'mbsnrtowcs'.
author Bruno Haible <bruno@clisp.org>
date Sun, 21 Dec 2008 14:45:44 +0100
parents c8051e85cbfd
children 197aac315d4d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
1 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
2
10454
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
3 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
4 dnl This file is free software; the Free Software Foundation
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
8 dnl Written by Eric Blake.
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
9
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
10 # wchar.m4 serial 16
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
11
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
12 AC_DEFUN([gl_WCHAR_H],
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
13 [
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
14 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
15 AC_CACHE_CHECK([whether <wchar.h> is standalone],
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
16 [gl_cv_header_wchar_h_standalone],
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
17 [AC_COMPILE_IFELSE([[#include <wchar.h>
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
18 wchar_t w;]],
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
19 [gl_cv_header_wchar_h_standalone=yes],
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
20 [gl_cv_header_wchar_h_standalone=no])])
10454
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
21
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
22 AC_REQUIRE([gt_TYPE_WINT_T])
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
23 if test $gt_cv_c_wint_t = yes; then
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
24 HAVE_WINT_T=1
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
25 else
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
26 HAVE_WINT_T=0
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
27 fi
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
28 AC_SUBST([HAVE_WINT_T])
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
29
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 9073
diff changeset
30 if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
31 WCHAR_H=wchar.h
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
32 fi
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
33
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
34 dnl Prepare for creating substitute <wchar.h>.
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
35 dnl Do it always: WCHAR_H may be empty here but can be set later.
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
36 dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
37 dnl character support).
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
38 AC_CHECK_HEADERS_ONCE([wchar.h])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
39 if test $ac_cv_header_wchar_h = yes; then
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
40 HAVE_WCHAR_H=1
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
41 else
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
42 HAVE_WCHAR_H=0
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
43 fi
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
44 AC_SUBST([HAVE_WCHAR_H])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
45 gl_CHECK_NEXT_HEADERS([wchar.h])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
46 ])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
47
10499
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
48 dnl Unconditionally enables the replacement of <wchar.h>.
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
49 AC_DEFUN([gl_REPLACE_WCHAR_H],
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
50 [
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
51 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
52 WCHAR_H=wchar.h
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
53 ])
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
54
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
55 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
56 [
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
57 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
58 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
59 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
60 ])
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
61
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
62 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
63 [
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
64 GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
65 GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
66 GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
67 GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
68 GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
69 GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
70 GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
71 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
72 dnl Assume proper GNU behavior unless another module says otherwise.
10895
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
73 HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10499
diff changeset
74 HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
75 HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
10910
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
76 HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
77 HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
78 HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
10917
e5c15988572b Ensure wctob is declared on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 10913
diff changeset
79 HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
80 HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
81 REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
10922
91831148c181 Work around wctob bug on Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 10917
diff changeset
82 REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
83 REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
84 REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
10925
c8051e85cbfd Override mbsrtowcs when redefining mbstate_t.
Bruno Haible <bruno@clisp.org>
parents: 10924
diff changeset
85 REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
86 REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
9073
eff03f4ce262 Remove the wcwidth.h file. Move wcwidth's declaration to wchar_.h.
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
87 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
10499
e94f2744d6b3 Avoid assigning WCHAR_H in different .m4 files.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
88 WCHAR_H=''; AC_SUBST([WCHAR_H])
7860
708da4ac0ccd Provide a robust <wchar.h>. Further simplifications are now
Eric Blake <ebb9@byu.net>
parents:
diff changeset
89 ])