summaryrefslogtreecommitdiff
path: root/lib/stdlib.in.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-04-28 15:53:35 +0200
committerAndy Wingo <wingo@pobox.com>2011-04-28 15:53:35 +0200
commit1903eae4c9ab97b575dad4ab1f5cf05436d84ab3 (patch)
treedbb5a83c4dce6f6f10642b3d39ec76ee63dd77a5 /lib/stdlib.in.h
parent0c81a0c13ad39c381e4ff4d073e3158bcfd51a7a (diff)
parent91956a94fe6363cf69d574b56397962ec6ef4468 (diff)
downloadguile-1903eae4c9ab97b575dad4ab1f5cf05436d84ab3.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts: GUILE-VERSION
Diffstat (limited to 'lib/stdlib.in.h')
-rw-r--r--lib/stdlib.in.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 980b909af..9651e94cd 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -255,9 +255,14 @@ _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
# endif
#endif
+/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
+ rely on GNU or POSIX semantics for malloc and realloc (for example,
+ by never specifying a zero size), so it does not need malloc or
+ realloc to be redefined. */
#if @GNULIB_MALLOC_POSIX@
# if @REPLACE_MALLOC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
# undef malloc
# define malloc rpl_malloc
# endif
@@ -267,7 +272,7 @@ _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
# endif
_GL_CXXALIASWARN (malloc);
-#elif defined GNULIB_POSIXCHECK
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
# undef malloc
/* Assume malloc is always declared. */
_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
@@ -531,7 +536,8 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
#if @GNULIB_REALLOC_POSIX@
# if @REPLACE_REALLOC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
# undef realloc
# define realloc rpl_realloc
# endif
@@ -541,7 +547,7 @@ _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
# endif
_GL_CXXALIASWARN (realloc);
-#elif defined GNULIB_POSIXCHECK
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
# undef realloc
/* Assume realloc is always declared. */
_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "