diff --git a/dlls/geoip/GeoIP.c b/dlls/geoip/GeoIP.c index 669c2079..c674a8f4 100755 --- a/dlls/geoip/GeoIP.c +++ b/dlls/geoip/GeoIP.c @@ -486,10 +486,10 @@ unsigned long _GeoIP_lookupaddress (const char *host) { struct hostent phe2; struct hostent * phe = &phe2; char *buf = NULL; - int buflength = 16384; - int herr = 0; int result = 0; #ifdef HAVE_GETHOSTBYNAME_R + int buflength = 16384; + int herr = 0; buf = malloc(buflength); #endif if (addr == INADDR_NONE) { diff --git a/dlls/geoip/GeoIP.h b/dlls/geoip/GeoIP.h index bbbb3ed7..ca66fa80 100755 --- a/dlls/geoip/GeoIP.h +++ b/dlls/geoip/GeoIP.h @@ -25,17 +25,15 @@ extern "C" { #endif -#ifdef _MSC_VER - #if _MSC_VER >= 1400 - /* Disable deprecation warnings concerning unsafe CRT functions */ - #define _CRT_SECURE_NO_DEPRECATE +#if defined _MSC_VER && _MSC_VER >= 1400 + /* Disable deprecation warnings concerning unsafe CRT functions */ + #define _CRT_SECURE_NO_DEPRECATE - /* Replace the POSIX function with ISO C++ conformant one as it is now deprecated */ - #define fileno _fileno + /* Replace the POSIX function with ISO C++ conformant one as it is now deprecated */ + #define fileno _fileno - /* Disable deprecation warnings because MSVC8 seemingly thinks ISO C++ conformant functions are deprecated. */ - #pragma warning (disable : 4996) - #endif + /* Disable deprecation warnings because MSVC8 seemingly thinks ISO C++ conformant functions are deprecated. */ + #pragma warning (disable : 4996) #endif #include