tools/gnulib: add macros to skip reallocarray() functions
authorMichael Pratt <mcpratt@pm.me>
Sat, 13 Apr 2024 19:04:54 +0000 (15:04 -0400)
committerRobert Marko <robimarko@gmail.com>
Thu, 25 Apr 2024 19:33:51 +0000 (21:33 +0200)
commit5ade7ee60ef726869d421673afc9aee97e851772
treebb97b8439a48fd47b0e60ec24d50948db2d96713
parent4de8c0e1d82275108ced490e6cb02e62c0ef2da5
tools/gnulib: add macros to skip reallocarray() functions

For modules that depend on the reallocarray module, like ialloc, xalloc,
and safe-alloc, it was not possible to skip importing the reallocarray
module as they all contained at least one function that called
reallocarray() and would cause build failure if the host system didn't
declare it.

This upstreamable patch adds macros that toggle whether to define
functions that depend on reallocarray() based on whether the reallocarray
module is being imported.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
tools/gnulib/patches/160-flag-reallocarray.patch [new file with mode: 0644]