diff options
Diffstat (limited to 'ndb/include/portlib/NdbTCP.h')
-rw-r--r-- | ndb/include/portlib/NdbTCP.h | 67 |
1 files changed, 13 insertions, 54 deletions
diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 6e2f18b61b2..42c34855c39 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -17,6 +17,9 @@ #ifndef NDB_TCP_H #define NDB_TCP_H +#include <ndb_global.h> +#include <ndb_net.h> + #if defined NDB_OSE || defined NDB_SOFTOSE /** * Include files needed @@ -24,7 +27,6 @@ #include "inet.h" #include <netdb.h> -#include <errno.h> #define NDB_NONBLOCK FNDELAY #define NDB_SOCKET_TYPE int @@ -38,47 +40,26 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#endif +#elif NDB_WIN32 -#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X /** * Include files needed */ -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <unistd.h> - -#include <netdb.h> -#include <errno.h> -#include <fcntl.h> - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) +#include <winsock2.h> +#include <ws2tcpip.h> -#define InetErrno errno +#define InetErrno WSAGetLastError() +#define EWOULDBLOCK WSAEWOULDBLOCK +#define NDB_SOCKET_TYPE SOCKET +#define NDB_INVALID_SOCKET INVALID_SOCKET +#define NDB_CLOSE_SOCKET(x) closesocket(x) -#endif +#else -#if defined NDB_LINUX || defined NDB_MACOSX /** * Include files needed */ -#include <sys/time.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <unistd.h> - #include <netdb.h> -#include <errno.h> -#include <fcntl.h> #define NDB_NONBLOCK O_NONBLOCK #define NDB_SOCKET_TYPE int @@ -89,29 +70,7 @@ typedef int socklen_t; #endif - -#ifdef NDB_WIN32 -/** - * Include files needed - */ -#include <winsock2.h> -#include <ws2tcpip.h> -#include <errno.h> - -#define InetErrno WSAGetLastError() -#define EWOULDBLOCK WSAEWOULDBLOCK -#define NDB_SOCKET_TYPE SOCKET -#define NDB_INVALID_SOCKET INVALID_SOCKET -#define NDB_CLOSE_SOCKET(x) closesocket(x) - -#endif - -#ifndef NDB_MACOSX -#define NDB_SOCKLEN_T socklen_t -#else -#define NDB_SOCKLEN_T int -#endif - +#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE #ifdef __cplusplus extern "C" { |