sockdef.h

00001 #ifndef SOCKDEF_H
00002 #define SOCKDEF_H 1
00003 
00004 #ifdef _WIN32
00005 
00006 #include <winsock.h>
00007 
00008 #define HAVE_NETINET_IN_H 1
00009 #define LASTSOCKERR GetLastError()
00010 #define EWOULDBLOCK WSAEWOULDBLOCK
00011 #define EINPROGRESS WSAEINPROGRESS
00012 #define EINTR WSAEINTR
00013 #define MSG_DONTWAIT 0
00014 #define CLOSESOCK(s) closesocket(s)
00015 #define IOCTL(s,c,a) ioctlsocket(s,c, (long *) a)
00016 
00017 #else
00018 
00019 #ifdef VXW
00020 #include <errno.h>
00021 #else
00022 #include <sys/errno.h>
00023 #endif
00024 
00025 #include <sys/socket.h>
00026 
00027 #ifdef VXW /* netdb.h is not supported */
00028 #include <rpc/rpcnetdb.h>
00029 #else
00030 #include <netdb.h>
00031 #endif
00032 
00033 #include <sys/ioctl.h>
00034 
00035 #ifdef VXW 
00036 #ifndef NATIVE_POLL
00037 #include <streams/poll.h>
00038 #endif
00039 #else
00040 #include <sys/poll.h>
00041 #endif
00042 
00043 #define LASTSOCKERR errno
00044 #define CLOSESOCK(s) close(s)
00045 #define IOCTL(s,c,a) ioctl(s,c,a)
00046 
00047 #ifdef VXW
00048 #define HAVE_NETINET_IN_H 1 /* Needed for htonl */
00049 #endif
00050 
00051 #ifdef VXW
00052 #include <net/mbuf.h> /* Needed for DONTWAIT */
00053 #define MSG_DONTWAIT 0 /* We don't have this flag for send() */
00054 #endif
00055 
00056 #ifdef HAVE_NETINET_IN_H
00057 #  include <netinet/in.h>
00058 #endif
00059 
00060 #ifdef HAVE_SYS_UN_H
00061 #  include <sys/un.h>
00062 #endif
00063 
00064 #define SOCKET int
00065 #define INVALID_SOCKET -1
00066 #define SOCKET_ERROR -1
00067 
00068 #ifdef VXW
00069 #include <sockLib.h> /* Needed for recv(), send() */
00070 #endif
00071 
00072 #endif
00073 
00074 
00075 
00076 #endif
00077 
00078 
00079 

Generated on Fri Aug 11 19:46:55 2006 for owwl by  doxygen 1.4.6