diff --git a/src/util/bdnet.cc b/src/util/bdnet.cc index 495a35c..b951f0e 100644 --- a/src/util/bdnet.cc +++ b/src/util/bdnet.cc @@ -276,13 +276,13 @@ int bdnet_inet_aton(const char *name, struct in_addr *addr) return (((*addr).s_addr = inet_addr(name)) != INADDR_NONE); } - - +#ifndef __MINGW64_VERSION_MAJOR int sleep(unsigned int sec) { Sleep(sec * 1000); return 0; } +#endif int usleep(unsigned int usec) { diff --git a/src/util/bdnet.h b/src/util/bdnet.h index fdc4c33..9b9d36f 100644 --- a/src/util/bdnet.h +++ b/src/util/bdnet.h @@ -131,9 +131,13 @@ std::string bdnet_inet_ntoa(struct in_addr in); */ #define EAGAIN 11 +#define EUSERS 87 + +#define EHOSTDOWN 112 + +#ifndef __MINGW64_VERSION_MAJOR #define EWOULDBLOCK EAGAIN -#define EUSERS 87 #define ENOTSOCK 88 #define EOPNOTSUPP 95 @@ -147,10 +151,10 @@ std::string bdnet_inet_ntoa(struct in_addr in); #define ETIMEDOUT 10060 // value from pthread.h #define ECONNREFUSED 111 -#define EHOSTDOWN 112 #define EHOSTUNREACH 113 #define EALREADY 114 #define EINPROGRESS 115 +#endif int bdnet_w2u_errno(int error); @@ -158,7 +162,9 @@ int bdnet_w2u_errno(int error); * ms uses millisecs. * void Sleep(int ms); */ +#ifndef __MINGW64_VERSION_MAJOR int sleep(unsigned int sec); +#endif int usleep(unsigned int usec); #endif // END of WINDOWS defines.