summaryrefslogtreecommitdiffstats
path: root/gl/m4/string_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/string_h.m4')
-rw-r--r--gl/m4/string_h.m475
1 files changed, 47 insertions, 28 deletions
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 2d5553c3..cf26123e 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
1# Configure a GNU-like replacement for <string.h>. 1# Configure a GNU-like replacement for <string.h>.
2 2
3# Copyright (C) 2007, 2008 Free Software Foundation, Inc. 3# Copyright (C) 2007-2010 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it, 5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6# with or without modifications, as long as this notice is preserved.
7 7
8# serial 6 8# serial 16
9 9
10# Written by Paul Eggert. 10# Written by Paul Eggert.
11 11
@@ -21,17 +21,29 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
21 AC_REQUIRE([AC_C_RESTRICT]) 21 AC_REQUIRE([AC_C_RESTRICT])
22 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) 22 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
23 gl_CHECK_NEXT_HEADERS([string.h]) 23 gl_CHECK_NEXT_HEADERS([string.h])
24
25 dnl Check for declarations of anything we want to poison if the
26 dnl corresponding gnulib module is not in use, and which is not
27 dnl guaranteed by C89.
28 gl_WARN_ON_USE_PREPARE([[#include <string.h>
29 ]],
30 [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
31 strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal
32 strverscmp])
24]) 33])
25 34
26AC_DEFUN([gl_STRING_MODULE_INDICATOR], 35AC_DEFUN([gl_STRING_MODULE_INDICATOR],
27[ 36[
28 dnl Use AC_REQUIRE here, so that the default settings are expanded once only. 37 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
29 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) 38 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
30 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 39 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
40 dnl Define it also as a C macro, for the benefit of the unit tests.
41 gl_MODULE_INDICATOR_FOR_TESTS([$1])
31]) 42])
32 43
33AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], 44AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
34[ 45[
46 GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
35 GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) 47 GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
36 GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) 48 GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
37 GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) 49 GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
@@ -40,6 +52,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
40 GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) 52 GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
41 GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) 53 GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
42 GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) 54 GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
55 GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT])
43 GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) 56 GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
44 GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) 57 GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN])
45 GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) 58 GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK])
@@ -63,30 +76,36 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
63 GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) 76 GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
64 GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) 77 GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
65 GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) 78 GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
66 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) 79 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
80 HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
67 dnl Assume proper GNU behavior unless another module says otherwise. 81 dnl Assume proper GNU behavior unless another module says otherwise.
68 HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) 82 HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
69 HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) 83 HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
70 HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) 84 HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
71 HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) 85 HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
72 HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) 86 HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
73 HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) 87 HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
74 HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) 88 HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
75 HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) 89 HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
76 HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) 90 HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
77 HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) 91 HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
78 HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) 92 HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
79 HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) 93 HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
80 HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) 94 HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
81 HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) 95 HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
82 HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) 96 HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
83 HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) 97 HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
84 HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) 98 HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
85 HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) 99 REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
86 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) 100 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
87 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) 101 REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
88 REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) 102 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
89 REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) 103 REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
90 REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) 104 REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
91 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) 105 REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
106 REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
107 REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
108 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
109 REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
110 UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
92]) 111])