Changeset 710 for trunk/mio/mio.h

Show
Ignore:
Timestamp:
16/10/08 15:49:41 (3 months ago)
Author:
ono
Message:

MIO_ERROR is not l-value on Windows [706], one should use MIO_SETERROR(e) instead of MIO_ERROR = e (#224)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/mio/mio.h

    r620 r710  
    166166/** all MIO related routines should use those for error reporting */ 
    167167#ifndef _WIN32 
    168 # define MIO_ERROR               errno 
    169 # define MIO_STRERROR(errno)     strerror(errno) 
    170 # define MIO_WOULDBLOCK          (errno == EWOULDBLOCK || errno == EINTR || errno == EAGAIN) 
     168# define MIO_ERROR       errno 
     169# define MIO_SETERROR(e) (errno = e) 
     170# define MIO_STRERROR(e) strerror(e) 
     171# define MIO_WOULDBLOCK  (errno == EWOULDBLOCK || errno == EINTR || errno == EAGAIN) 
    171172#else /* _WIN32 */ 
    172173JABBERD2_API char *mio_strerror(int code); 
    173 # define MIO_ERROR               WSAGetLastError() 
    174 # define MIO_STRERROR(errno)     mio_strerror(errno) 
    175 # define MIO_WOULDBLOCK          (WSAGetLastError() == WSAEWOULDBLOCK) 
     174# define MIO_ERROR       WSAGetLastError() 
     175# define MIO_SETERROR(e) WSASetLastError(e) 
     176# define MIO_STRERROR(e) mio_strerror(e) 
     177# define MIO_WOULDBLOCK  (WSAGetLastError() == WSAEWOULDBLOCK) 
    176178#endif /* _WIN32 */ 
    177179