summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-01-03 15:17:02 +0100
committerBruno Haible <bruno@clisp.org>2022-01-03 15:17:02 +0100
commit316ba778dc74385399d7bc10ec0fa1dfb8374e49 (patch)
tree717de7dd27041788823d2aaa3760e42111f4f078 /lib
parent5427cd71962b646bbb084233c5847b02b94b8f06 (diff)
downloadgnulib-316ba778dc74385399d7bc10ec0fa1dfb8374e49.tar.gz
calloc-gnu: Allow use as dependency from test modules.
* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Set REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. (gl_FUNC_CALLOC_POSIX): Set REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the calloc-gnu module indicator. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/stdlib (Makefile.am): Substitute GNULIB_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/calloc-posix (Depends-on, configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * modules/calloc-gnu (Depends-on): Add xalloc-oversized. (configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. Set a module indicator. * lib/stdlib.in.h (calloc): Test REPLACE_CALLOC_FOR_CALLOC_POSIX, REPLACE_CALLOC_FOR_CALLOC_GNU, and the respective module indicators instead of just REPLACE_CALLOC.
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib.in.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 5664fd216f..64231c2d5f 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -260,7 +260,8 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
#endif
#if @GNULIB_CALLOC_POSIX@
-# if @REPLACE_CALLOC@
+# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
+ || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef calloc
# define calloc rpl_calloc