From 3c4ff2ceb67da2b0183fc9c1166a41e0a2f0319f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Oct 2013 21:42:15 +0000 Subject: [PATCH] Code maintenance for Qt 5: - Fixed compile with MinGW-w64 under Windows git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6866 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- src/util/bdnet.cc | 4 ++-- src/util/bdnet.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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.