SOCKET: Include system include files prior to referencing macros that they may define.
Fix #302
This commit is contained in:
parent
5a5df503af
commit
14d1c4e2da
1 changed files with 12 additions and 19 deletions
31
sim_sock.h
31
sim_sock.h
|
@ -50,6 +50,18 @@
|
|||
#include <winsock2.h>
|
||||
|
||||
#elif !defined (__OS2__) || defined (__EMX__) /* VMS, Mac, Unix, OS/2 EMX */
|
||||
#include <sys/types.h> /* for fcntl, getpid */
|
||||
#include <sys/socket.h> /* for sockets */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h> /* for sockaddr_in */
|
||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
|
||||
#include <arpa/inet.h> /* for inet_addr and inet_ntoa */
|
||||
#include <netdb.h>
|
||||
#include <sys/time.h> /* for EMX */
|
||||
|
||||
#define WSAGetLastError() errno /* Windows macros */
|
||||
#define WSASetLastError(err) errno = err
|
||||
#define closesocket close
|
||||
|
@ -75,24 +87,10 @@
|
|||
#define WSAEINTR EINTR
|
||||
#define INVALID_SOCKET ((SOCKET)-1)
|
||||
#define SOCKET_ERROR -1
|
||||
#include <sys/types.h> /* for fcntl, getpid */
|
||||
#include <sys/socket.h> /* for sockets */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h> /* for sockaddr_in */
|
||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
|
||||
#include <arpa/inet.h> /* for inet_addr and inet_ntoa */
|
||||
#include <netdb.h>
|
||||
#include <sys/time.h> /* for EMX */
|
||||
#endif
|
||||
|
||||
#if defined (VMS) /* VMS unique */
|
||||
#include <ioctl.h> /* for ioctl */
|
||||
#if !defined (timerclear)
|
||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
#endif
|
||||
#if !defined (AI_NUMERICHOST)
|
||||
#define AI_NUMERICHOST 0
|
||||
#endif
|
||||
|
@ -100,11 +98,6 @@
|
|||
#define sockaddr_storage sockaddr
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__EMX__) /* OS/2 unique */
|
||||
#if !defined (timerclear)
|
||||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(CBUFSIZE)
|
||||
#define CBUFSIZE 1024
|
||||
|
|
Loading…
Add table
Reference in a new issue