From 71fbdb50ab5b0da7053a93975612b42f0d2e591b Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 6 Jan 2025 13:56:40 -0800 Subject: [PATCH] servent tests: Fix failure on 32-bit native Windows. * tests/test-servent.c (getservbyname, getservbyport) [_WIN64 && !__CYGWIN__]: Disable signature check. * doc/posix-functions/getservbyname.texi: Document the incompatible __stdcall function signature. * doc/posix-functions/getservbyport.texi: Likewise. --- ChangeLog | 9 +++++++++ doc/posix-functions/getservbyname.texi | 3 +++ doc/posix-functions/getservbyport.texi | 3 +++ tests/test-servent.c | 6 ++++++ 4 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index d9819dbc50..601407cce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2025-01-06 Collin Funk + + servent tests: Fix failure on 32-bit native Windows. + * tests/test-servent.c (getservbyname, getservbyport) + [_WIN64 && !__CYGWIN__]: Disable signature check. + * doc/posix-functions/getservbyname.texi: Document the incompatible + __stdcall function signature. + * doc/posix-functions/getservbyport.texi: Likewise. + 2025-01-05 Paul Eggert parse-datetime-tests: port to Gnulib mktime diff --git a/doc/posix-functions/getservbyname.texi b/doc/posix-functions/getservbyname.texi index f52be6dab8..93eddab92e 100644 --- a/doc/posix-functions/getservbyname.texi +++ b/doc/posix-functions/getservbyname.texi @@ -17,4 +17,7 @@ mingw, MSVC 14. Portability problems not fixed by Gnulib: @itemize +@item +On Windows, in 32-bit mode, this function is defined with a calling +convention that is different from @code{cdecl}. @end itemize diff --git a/doc/posix-functions/getservbyport.texi b/doc/posix-functions/getservbyport.texi index 03c04e6769..01665136c4 100644 --- a/doc/posix-functions/getservbyport.texi +++ b/doc/posix-functions/getservbyport.texi @@ -17,4 +17,7 @@ mingw, MSVC 14. Portability problems not fixed by Gnulib: @itemize +@item +On Windows, in 32-bit mode, this function is defined with a calling +convention that is different from @code{cdecl}. @end itemize diff --git a/tests/test-servent.c b/tests/test-servent.c index fb93e1ae83..0e774bdfcc 100644 --- a/tests/test-servent.c +++ b/tests/test-servent.c @@ -22,9 +22,15 @@ #include #include "signature.h" + +#if defined _WIN64 && !defined __CYGWIN__ +/* On 32-bit native Windows, these two functions may have the __stdcall calling + convention. But the SIGNATURE_CHECK works only for functions with __cdecl + calling convention. */ SIGNATURE_CHECK (getservbyname, struct servent *, (char const *, char const *)); SIGNATURE_CHECK (getservbyport, struct servent *, (int, char const *)); +#endif #include #include -- 2.39.5