summaryrefslogtreecommitdiff
path: root/lib/string.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string.in.h')
-rw-r--r--lib/string.in.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/string.in.h b/lib/string.in.h
index fa2e40c257..6214b55784 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -47,9 +47,6 @@
/* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h>
-/* Get free(). */
-#include <stdlib.h>
-
/* MirBSD defines mbslen as a macro. */
#if @GNULIB_MBSLEN@ && defined __MirBSD__
# include <wchar.h>
@@ -86,6 +83,12 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
+/* Declare 'free' if needed for _GL_ATTRIBUTE_DEALLOC_FREE. */
+#if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+# define free rpl_free
+#endif
+_GL_EXTERN_C void free (void *);
/* Clear a block of memory. The compiler will not delete a call to
this function, even if the block is dead after the call. */