external/libassuan: Fix fallout of defining __STDC__ on Windowsmimo-7.0.7.0.M15
commit5d969ce25538238066aaa3879746aae95959d03d
authorStephan Bergmann <sbergman@redhat.com>
Fri, 22 Apr 2022 19:52:50 +0000 (22 21:52 +0200)
committerAron Budea <aron.budea@collabora.com>
Thu, 30 May 2024 19:39:13 +0000 (30 21:39 +0200)
tree41d88568d8c091a0c13b3670df62c4372abf34c9
parentabe1e391f2a5f190984d8bafd7f9613639cb93b1
external/libassuan: Fix fallout of defining __STDC__ on Windows

...since 1bb0e177124d5d6661b72df6c7d848fb23639652 "Fix autoconf>=2.70
gcc-wrapper breakage", which had the side effect of preventing various
deprecated function declarations in system headers (e.g., isascii in addition to
__isascii).  This went unnoticed so far due to the traditionally lax handling of
missing function declarations in C, and only now started to cause

> conversion.c(94,9): error: call to undeclared function 'isascii'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>           if ((isascii (*istr) && isprint (*istr)) || (*istr >= 0x80))
>                ^

etc. with clang-cl 15 trunk after
<https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626>
"[C11/C2x] Change the behavior of the implicit function declaration warning".

Where undeclared functions have been used in Windows-only code, they have been
replaced with their __STDC__-declared counterparts, and for occurrences in
shared code Windows-only macro definitions have been introduced (as would have
done in the system headers too, if __STDC__ was not defined) to not clutter the
shared code with #ifdefs.

Also, for getpid (resp. _getpid), the #include <process.h> was apparently
missing from the upstream code, even without our __STDC__ hack in
external/libassuan/ExternalProject_libassuan.mk (but never caused errors until
now, either).

Change-Id: I7442394d0c6e633bca1f6c7331d7ee51651179a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133339
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 8279d89d6e037def78f50c72fab2116ca56bef52)
(cherry picked from commit 1f683fe50fe0e850a7a978228a71c84356b38cf6)
external/libassuan/UnpackedTarball_libassuan.mk
external/libassuan/w32-stdc.patch [new file with mode: 0644]