From 7acb7eaa00fb1409e8de23e13bc0fb11c3f59c91 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Mon, 12 Sep 2016 15:48:56 +0200 Subject: [PATCH] Move WINVER definition before other includes (#350) --- src/modbus-tcp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index abbff5b..cda4c67 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -4,6 +4,15 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#if defined(_WIN32) +# define OS_WIN32 +/* ws2_32.dll has getaddrinfo and freeaddrinfo on Windows XP and later. + * minwg32 headers check WINVER before allowing the use of these */ +# ifndef WINVER +# define WINVER 0x0501 +# endif +#endif + #include #include #include @@ -15,12 +24,6 @@ #include #if defined(_WIN32) -# define OS_WIN32 -/* ws2_32.dll has getaddrinfo and freeaddrinfo on Windows XP and later. - * minwg32 headers check WINVER before allowing the use of these */ -# ifndef WINVER -# define WINVER 0x0501 -# endif /* Already set in modbus-tcp.h but it seems order matters in VS2005 */ # include # include -- libgit2 0.21.4