]> source.dussan.org Git - tigervnc.git/commitdiff
Fix Winsock errno code overlap
authorPierre Ossman <ossman@cendio.se>
Fri, 29 May 2015 14:54:21 +0000 (16:54 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 29 May 2015 14:58:02 +0000 (16:58 +0200)
Some Winsock errno:s conflict with the standard ones. Try to
restrict the redefines to things relevant for sockets.

common/os/winerrno.h
common/rdr/FdInStream.cxx
common/rdr/FdOutStream.cxx

index aebbdbe79019d42f78b6888576d36647b9c94efa..052d4de2b48265d87f17650b2a9b4fba82a0f388 100644 (file)
@@ -2,21 +2,9 @@
 /* Generated with:
 cat /usr/i686-pc-mingw32/sys-root/mingw/include/winerror.h \
  | awk '/#define WSAE.*WSABASE/{gsub("WSA", ""); print "#undef " $2 "\n#define " $2 " WSA" $2}' \
- | egrep -v '_QOS|PROVIDER|PROCTABLE'
+ | egrep -v 'EINTR|EBADF|EACCES|EFAULT|EINVAL|EMFILE|_QOS|PROVIDER|PROCTABLE'
 */
 
-#undef EINTR
-#define EINTR WSAEINTR
-#undef EBADF
-#define EBADF WSAEBADF
-#undef EACCES
-#define EACCES WSAEACCES
-#undef EFAULT
-#define EFAULT WSAEFAULT
-#undef EINVAL
-#define EINVAL WSAEINVAL
-#undef EMFILE
-#define EMFILE WSAEMFILE
 #undef EWOULDBLOCK
 #define EWOULDBLOCK WSAEWOULDBLOCK
 #undef EINPROGRESS
index 22433a1b74f084904926f80f61196d08ba0b0828..9f35c9fbfcc344f1222df08fe6b3b56823ade580 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <errno.h>
 #ifdef _WIN32
 #include <winsock2.h>
 #ifndef _WIN32_WCE
@@ -34,7 +35,6 @@
 #include <os/winerrno.h>
 #else
 #include <sys/types.h>
-#include <errno.h>
 #include <unistd.h>
 #include <sys/time.h>
 #endif
index 83360d64c57b4d61675fa389943a0036e8b0925b..75131a6476661aba8edb4c4e7696bb1f0ae72fa2 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <errno.h>
 #ifdef _WIN32
 #include <winsock2.h>
 #define write(s,b,l) send(s,(const char*)b,l,0)
@@ -31,7 +32,6 @@
 #include <os/winerrno.h>
 #else
 #include <sys/types.h>
-#include <errno.h>
 #include <unistd.h>
 #include <sys/time.h>
 #endif