From 9dcf781d01fd4f8551c926911d6c130e3f6e2f42 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 19 Jun 2019 06:49:24 +0100 Subject: [PATCH] Make the w32old build warning-clean. Normally I never notice warnings in this build, because it runs inside bob and dumps all the warnings in a part of the build log I never look at. But I've had these fixes lying around for a while and should commit them. They're benign: all we need is an explicit declaration of strtoumax to replace the one that stdlib.h doesn't provide, and a couple more of those annoying NO_TYPECHECK modifiers on GET_WINDOWS_FUNCTION calls. --- defs.h | 3 ++- windows/winnet.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defs.h b/defs.h index e9050cf9..afeb5062 100644 --- a/defs.h +++ b/defs.h @@ -16,12 +16,13 @@ #include #if defined _MSC_VER && _MSC_VER < 1800 -/* Work around lack of inttypes.h in older MSVC */ +/* Work around lack of inttypes.h and strtoumax in older MSVC */ #define PRIx32 "x" #define PRIu64 "I64u" #define PRIdMAX "I64d" #define PRIXMAX "I64X" #define SCNu64 "I64u" +uintmax_t strtoumax(const char *nptr, char **endptr, int base); #else #include #endif diff --git a/windows/winnet.c b/windows/winnet.c index b8177ce2..ae5b11f6 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -247,7 +247,7 @@ void sk_init(void) if (GetProcAddress(winsock_module, "getaddrinfo") != NULL) { GET_WINDOWS_FUNCTION(winsock_module, getaddrinfo); GET_WINDOWS_FUNCTION(winsock_module, freeaddrinfo); - GET_WINDOWS_FUNCTION(winsock_module, getnameinfo); + GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, getnameinfo); /* This function would fail its type-check if we did one, * because the VS header file provides an inline definition * which is __cdecl instead of WINAPI. */ @@ -258,8 +258,8 @@ void sk_init(void) if (wship6_module) { GET_WINDOWS_FUNCTION(wship6_module, getaddrinfo); GET_WINDOWS_FUNCTION(wship6_module, freeaddrinfo); - GET_WINDOWS_FUNCTION(wship6_module, getnameinfo); /* See comment above about type check */ + GET_WINDOWS_FUNCTION_NO_TYPECHECK(wship6_module, getnameinfo); GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gai_strerror); } else { }