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 89fe655aee)
This commit is contained in:
Thijs Schreijer 2012-04-10 23:31:10 +02:00 committed by Marcelo Roberto Jimenez
parent 4e25119237
commit 615f5d18ac
2 changed files with 8 additions and 2 deletions

View File

@ -35,10 +35,13 @@
/* Unix-specific network utilities */
#include "UpnpInet.h"
#include <errno.h>
#ifdef WIN32
typedef int socklen_t;
#define EAFNOSUPPORT 97
#ifndef EAFNOSUPPORT /* VS2010 has this defined */
#define EAFNOSUPPORT 97
#endif
#else
#include <sys/time.h>
#include <sys/wait.h>

View File

@ -38,6 +38,7 @@
*/
#include "upnp.h"
#include <errno.h>
/* 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)