summaryrefslogtreecommitdiff
path: root/modules/string
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-09-07 17:51:39 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-09-07 17:56:01 -0700
commita4a2d039a9117266ed8cb1977241e7c34b368993 (patch)
treea22569b38117ddc2c4d38ad74176d8968bdaa638 /modules/string
parent2c062d406a8ce00165b3b78c765e7f6a07ec8615 (diff)
downloadgnulib-a4a2d039a9117266ed8cb1977241e7c34b368993.tar.gz
string, wchar: avoid some namespace pollution
* lib/string.in.h, lib/wchar.in.h: (free): Declare by hand instead of including stdlib.h. This avoids some namespace pollution. It should also avoid some nested-include problems described by Lucy Phipps in: https://lists.gnu.org/r/bug-gnulib/2021-09/msg00018.html * modules/string, modules/wchar: (Depends-on): Add stdlib, so that REPLACE_FREE has the right value. (Makefile.am): Replace @REPLACE_FREE@ when creating the include file.
Diffstat (limited to 'modules/string')
-rw-r--r--modules/string2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/string b/modules/string
index e1d9980bbd..306834591e 100644
--- a/modules/string
+++ b/modules/string
@@ -13,6 +13,7 @@ snippet/arg-nonnull
snippet/c++defs
snippet/warn-on-use
stddef
+stdlib
configure.ac:
gl_STRING_H
@@ -102,6 +103,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \