annotate m4/mbsinit.m4 @ 40196:e63f5d3edab5

relocatable-prog: Update documentation. * doc/relocatable-maint.texi (Supporting Relocation): Update to match the recent changes.
author Bruno Haible <bruno@clisp.org>
date Sun, 24 Feb 2019 01:49:15 +0100
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15483
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
1 # mbsinit.m4 serial 8
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 dnl Copyright (C) 2008, 2010-2019 Free Software Foundation, Inc.
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_MBSINIT],
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
14345
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
10 AC_REQUIRE([AC_CANONICAL_HOST])
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 AC_REQUIRE([AC_TYPE_MBSTATE_T])
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10904
diff changeset
13 gl_MBSTATE_T_BROKEN
13158
6c2a74cfe75b mbsinit, mbrtowc, wcrtomb: Improve idioms.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
14
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 AC_CHECK_FUNCS_ONCE([mbsinit])
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 if test $ac_cv_func_mbsinit = no; then
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 HAVE_MBSINIT=0
15483
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
18 AC_CHECK_DECLS([mbsinit],,, [[
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
19 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
20 <wchar.h>.
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
21 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
22 included before <wchar.h>. */
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
23 #include <stddef.h>
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
24 #include <stdio.h>
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
25 #include <time.h>
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
26 #include <wchar.h>
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
27 ]])
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
28 if test $ac_cv_have_decl_mbsinit = yes; then
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
29 dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
30 dnl it does not have the function. Avoid a collision with gnulib's
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
31 dnl replacement.
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
32 REPLACE_MBSINIT=1
1aca03539329 Work around declaration collisions on Minix.
Bruno Haible <bruno@clisp.org>
parents: 15031
diff changeset
33 fi
13158
6c2a74cfe75b mbsinit, mbrtowc, wcrtomb: Improve idioms.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
34 else
6c2a74cfe75b mbsinit, mbrtowc, wcrtomb: Improve idioms.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
35 if test $REPLACE_MBSTATE_T = 1; then
6c2a74cfe75b mbsinit, mbrtowc, wcrtomb: Improve idioms.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
36 REPLACE_MBSINIT=1
14345
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
37 else
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
38 dnl On mingw, mbsinit() always returns 1, which is inappropriate for
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
39 dnl states produced by mbrtowc() for an incomplete multibyte character
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
40 dnl in multibyte locales.
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
41 case "$host_os" in
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
42 mingw*) REPLACE_MBSINIT=1 ;;
38e1a5ec714d mbsinit: Work around mingw bug.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
43 esac
13158
6c2a74cfe75b mbsinit, mbrtowc, wcrtomb: Improve idioms.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
44 fi
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10904
diff changeset
45 fi
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 ])
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 # Prerequisites of lib/mbsinit.c.
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 AC_DEFUN([gl_PREREQ_MBSINIT], [
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 :
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 ])