Ver código fonte

Fix Winsock errno code overlap

Some Winsock errno:s conflict with the standard ones. Try to
restrict the redefines to things relevant for sockets.
tags/v1.4.90
Pierre Ossman 9 anos atrás
pai
commit
500cb6ef11
3 arquivos alterados com 3 adições e 15 exclusões
  1. 1
    13
      common/os/winerrno.h
  2. 1
    1
      common/rdr/FdInStream.cxx
  3. 1
    1
      common/rdr/FdOutStream.cxx

+ 1
- 13
common/os/winerrno.h Ver arquivo

@@ -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

+ 1
- 1
common/rdr/FdInStream.cxx Ver arquivo

@@ -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

+ 1
- 1
common/rdr/FdOutStream.cxx Ver arquivo

@@ -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

Carregando…
Cancelar
Salvar