tools/gnulib: make tdestroy() fully portable
authorMichael Pratt <mcpratt@pm.me>
Mon, 8 Apr 2024 07:47:23 +0000 (03:47 -0400)
committerRobert Marko <robimarko@gmail.com>
Thu, 25 Apr 2024 19:33:51 +0000 (21:33 +0200)
commiteb726c90be67b8aa3638e2b9e988cd3865ed3b49
tree40ce0b00e4eab36a3ad6c1dc67c2fc0dbed2d420
parent5ade7ee60ef726869d421673afc9aee97e851772
tools/gnulib: make tdestroy() fully portable

The tdestroy() function, which is a GNU extension to the standard C
library, is defined in gnulib in tsearch.c but is missing it's
corresponding declaration in search.in.h by being completely missing...

This patch is large but upstreamable, including all of the macros and
conditionals and configure checks that upstream GNU would expect for
portable support, like using the @@ placeholder/substitution method to
determine whether or not to have declarations based on whether or not
tdestroy() is already declared within the standard headers of the default
include paths.

There were also some typedefs and aliases missing, along with the warnings
and preprocessor exceptions that need to be added for consistency with the
usage of the rest of the functions in the files.

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/150-portable-tdestroy.patch [new file with mode: 0644]