From 615f5d18aca92ed588e7388d126c775edf164993 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Tue, 10 Apr 2012 23:31:10 +0200 Subject: [PATCH] Fixed redefinition warnings for EAFNOSUPPORT and EADDRINUSE, Google turned up that they are newly defined in VS2010 unixutil.h, line 41 upnputil.h, line 125 Had a look here; http://bugs.ruby-lang.org/issues/3092 and added the mentioned fixes as found here; http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/win32.h?r1=27222&r2=27236&pathrev=27258&diff_format=h and here http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/win32.h?r1=27236&r2=27258&pathrev=27258&diff_format=h (cherry picked from commit 89fe655aee4e424946e87235e2e0f4045378cba1) --- upnp/src/inc/unixutil.h | 5 ++++- upnp/src/inc/upnputil.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/upnp/src/inc/unixutil.h b/upnp/src/inc/unixutil.h index da46b58..30e4269 100644 --- a/upnp/src/inc/unixutil.h +++ b/upnp/src/inc/unixutil.h @@ -35,10 +35,13 @@ /* Unix-specific network utilities */ #include "UpnpInet.h" +#include #ifdef WIN32 typedef int socklen_t; - #define EAFNOSUPPORT 97 + #ifndef EAFNOSUPPORT /* VS2010 has this defined */ + #define EAFNOSUPPORT 97 + #endif #else #include #include diff --git a/upnp/src/inc/upnputil.h b/upnp/src/inc/upnputil.h index 7236d6d..76292f8 100644 --- a/upnp/src/inc/upnputil.h +++ b/upnp/src/inc/upnputil.h @@ -38,6 +38,7 @@ */ #include "upnp.h" +#include /* usually used to specify direction of parameters in functions */ #ifndef IN @@ -122,7 +123,9 @@ void linecopylen( #ifndef S_ISDIR #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif - #define EADDRINUSE WSAEADDRINUSE + #ifndef EADDRINUSE /* VS2010 has this defined */ + #define EADDRINUSE WSAEADDRINUSE + #endif #define strcasecmp stricmp #define strncasecmp strnicmp #define sleep(a) Sleep((a)*1000)