libUPnP  1.6.17
UpnpInet.h
Go to the documentation of this file.
00001 #ifndef UPNPINET_H
00002 #define UPNPINET_H
00003 
00014 #include "UpnpUniStd.h" /* for close() */
00015 
00016 #ifdef WIN32
00017         #include <stdarg.h>
00018         #ifndef UPNP_USE_MSVCPP
00019                 /* Removed: not required (and cause compilation issues) */
00020                 #include <winbase.h>
00021                 #include <windef.h>
00022         #endif
00023         #include <winsock2.h>
00024         #include <iphlpapi.h>
00025         #include <ws2tcpip.h>
00026 
00027         #define UpnpCloseSocket closesocket
00028 
00029         #if(_WIN32_WINNT < 0x0600)
00030                 typedef short sa_family_t;
00031         #else
00032                 typedef ADDRESS_FAMILY sa_family_t;
00033         #endif
00034 
00035 #else /* WIN32 */
00036         #include <sys/param.h>
00037         #if defined(__sun)
00038                 #include <fcntl.h>
00039                 #include <sys/sockio.h>
00040         #elif (defined(BSD) && BSD >= 199306) || defined (__FreeBSD_kernel__)
00041                 #include <ifaddrs.h>
00042                 /* Do not move or remove the include below for "sys/socket"!
00043                  * Will break FreeBSD builds. */
00044                 #include <sys/socket.h>
00045         #endif
00046         #include <arpa/inet.h>  /* for inet_pton() */
00047         #include <net/if.h>
00048         #include <netinet/in.h>
00049 
00053         typedef int SOCKET;
00054 
00056         #define INVALID_SOCKET (-1)
00057 
00059         #define SOCKET_ERROR (-1)
00060 
00062         #define UpnpCloseSocket close
00063 #endif /* WIN32 */
00064 
00065 /* @} Sock */
00066 
00067 #endif /* UPNPINET_H */