From 836310c39220b12b2ae3be37d121a57632e07984 Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Sat, 12 Jun 2010 19:26:34 +0000 Subject: [PATCH] Enable IPv6-support on win32 if target os is windows xp or newer (win2k lacks needed functions) --- server/gkrellmd-private.h | 7 +++++++ src/inet.h | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/gkrellmd-private.h b/server/gkrellmd-private.h index 43ec60e..a489879 100644 --- a/server/gkrellmd-private.h +++ b/server/gkrellmd-private.h @@ -35,6 +35,13 @@ #include "../src/gkrellm-sysdeps.h" +#if defined(WIN32) +// Enable getaddrinfo on win32 if we target win xp or newer +#if _WIN32_WINNT > 0x0500 +#define HAVE_GETADDRINFO 1 +#endif +#endif + #if defined(__linux__) #if defined(__GLIBC__) && ((__GLIBC__>2)||(__GLIBC__==2 && __GLIBC_MINOR__>=1)) #define HAVE_GETADDRINFO 1 diff --git a/src/inet.h b/src/inet.h index 7e086b2..53b6487 100644 --- a/src/inet.h +++ b/src/inet.h @@ -37,8 +37,12 @@ #include #else #include +#include +// Enable IPV6 on win32 if we target win xp or newer +#if defined(IPPROTO_IPV6) && (_WIN32_WINNT > 0x0500) +#define INET6 +#endif #endif - #if defined(__linux__) #if defined(IPPROTO_IPV6)