From: Bruno Haible Date: Sun, 18 Dec 2016 00:49:50 +0000 (+0100) Subject: getaddrinfo tests: Avoid compilation error on MSVC. X-Git-Tag: v1.0~6457 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=2ebd13d97452e41fbd2d1068b38f22a4b714fec3;p=gnulib.git getaddrinfo tests: Avoid compilation error on MSVC. * tests/test-getaddrinfo.c: Don't check the prototypes of freeaddrinfo, getaddrinfo on native Windows. --- diff --git a/ChangeLog b/ChangeLog index 1ecdb7ff51..fdf61ab0ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-12-17 Bruno Haible + + getaddrinfo tests: Avoid compilation error on MSVC. + * tests/test-getaddrinfo.c: Don't check the prototypes of freeaddrinfo, + getaddrinfo on native Windows. + 2016-12-17 Bruno Haible getlogin, getlogin_r: Fix link errors on MSVC. @@ -84860,7 +84866,7 @@ o Test only that noncanonical values do not cause crashes, not that 2006-11-16 Paul Eggert - * modules/getaddinfo (Depends-on): Remove inttostr; add snprintf. + * modules/getaddrinfo (Depends-on): Remove inttostr; add snprintf. * lib/getaddrinfo.c: Include snprintf.h rather than intprops.h and inttostr.h. Use snprintf rather than uinttostr, so that LGPLed code doesn't depend on GPLed. diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c index 0251632803..f7d4caabfa 100644 --- a/tests/test-getaddrinfo.c +++ b/tests/test-getaddrinfo.c @@ -22,11 +22,16 @@ #include #include "signature.h" -SIGNATURE_CHECK (freeaddrinfo, void, (struct addrinfo *)); SIGNATURE_CHECK (gai_strerror, char const *, (int)); +/* On native Windows, these two functions may have the __stdcall calling + convention. But the SIGNATURE_CHECK works only for functions with __cdecl + calling convention. */ +#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) +SIGNATURE_CHECK (freeaddrinfo, void, (struct addrinfo *)); SIGNATURE_CHECK (getaddrinfo, int, (char const *, char const *, struct addrinfo const *, struct addrinfo **)); +#endif #include #include