changeset 39887:e6ce7ef2af3e

explicit_bzero: Make it possible to namespace the defined symbol. * lib/explicit_bzero.c (explicit_bzero): Don't undefine outside of glibc.
author Bruno Haible <bruno@clisp.org>
date Fri, 05 Oct 2018 21:49:39 +0200
parents 2114f093579b
children 281300b4ad17
files ChangeLog lib/explicit_bzero.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 05 18:42:44 2018 +0200
+++ b/ChangeLog	Fri Oct 05 21:49:39 2018 +0200
@@ -1,3 +1,9 @@
+2018-10-05  Bruno Haible  <bruno@clisp.org>
+
+	explicit_bzero: Make it possible to namespace the defined symbol.
+	* lib/explicit_bzero.c (explicit_bzero): Don't undefine outside of
+	glibc.
+
 2018-10-05  Bruno Haible  <bruno@clisp.org>
 
 	mkdir-p: Depend on 'mkdir'.
--- a/lib/explicit_bzero.c	Fri Oct 05 18:42:44 2018 +0200
+++ b/lib/explicit_bzero.c	Fri Oct 05 21:49:39 2018 +0200
@@ -27,9 +27,11 @@
 
 #include <string.h>
 
+#if _LIBC
 /* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
    redirects to that.  */
-#undef explicit_bzero
+# undef explicit_bzero
+#endif
 
 /* Set LEN bytes of S to 0.  The compiler will not delete a call to
    this function, even if S is dead after the call.  */