groupsock/include/NetCommon.h

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 /* "groupsock" interface
00017  * Copyright (c) 1996-2012 Live Networks, Inc.  All rights reserved.
00018  * Common include files, typically used for networking
00019  */
00020 
00021 #ifndef _NET_COMMON_H
00022 #define _NET_COMMON_H
00023 
00024 #if defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_WCE)
00025 /* Windows */
00026 #if defined(WINNT) || defined(_WINNT) || defined(__BORLANDC__) || defined(__MINGW32__) || defined(_WIN32_WCE)
00027 #define _MSWSOCK_
00028 #include <winsock2.h>
00029 #include <ws2tcpip.h>
00030 #endif
00031 #include <windows.h>
00032 #include <string.h>
00033 
00034 #define closeSocket closesocket
00035 #define EWOULDBLOCK WSAEWOULDBLOCK
00036 #define EINPROGRESS WSAEWOULDBLOCK
00037 #define EAGAIN WSAEWOULDBLOCK
00038 #define EINTR WSAEINTR
00039 
00040 #if defined(_WIN32_WCE)
00041 #define NO_STRSTREAM 1
00042 #endif
00043 
00044 /* Definitions of size-specific types: */
00045 typedef __int64 int64_t;
00046 typedef unsigned __int64 u_int64_t;
00047 typedef unsigned u_int32_t;
00048 typedef unsigned short u_int16_t;
00049 typedef unsigned char u_int8_t;
00050 // For "uintptr_t" and "intptr_t", we assume that if they're not already defined, then this must be
00051 // an old, 32-bit version of Windows:
00052 #if !defined(_MSC_STDINT_H_) && !defined(_UINTPTR_T_DEFINED) && !defined(_UINTPTR_T_DECLARED) && !defined(_UINTPTR_T)
00053 typedef unsigned uintptr_t;
00054 #endif
00055 #if !defined(_MSC_STDINT_H_) && !defined(_INTPTR_T_DEFINED) && !defined(_INTPTR_T_DECLARED) && !defined(_INTPTR_T)
00056 typedef int intptr_t;
00057 #endif
00058 
00059 #elif defined(VXWORKS)
00060 /* VxWorks */
00061 #include <time.h>
00062 #include <timers.h>
00063 #include <sys/times.h>
00064 #include <sockLib.h>
00065 #include <hostLib.h>
00066 #include <resolvLib.h>
00067 #include <ioLib.h>
00068 
00069 typedef unsigned int u_int32_t;
00070 typedef unsigned short u_int16_t;
00071 typedef unsigned char u_int8_t;
00072 
00073 #else
00074 /* Unix */
00075 #include <sys/types.h>
00076 #include <sys/socket.h>
00077 #include <sys/time.h>
00078 #include <netinet/in.h>
00079 #include <arpa/inet.h>
00080 #include <netdb.h>
00081 #include <unistd.h>
00082 #include <string.h>
00083 #include <stdlib.h>
00084 #include <errno.h>
00085 #include <strings.h>
00086 #include <ctype.h>
00087 #include <stdint.h>
00088 #if defined(_QNX4)
00089 #include <sys/select.h>
00090 #include <unix.h>
00091 #endif
00092 
00093 #define closeSocket close
00094 
00095 #ifdef SOLARIS
00096 #define u_int64_t uint64_t
00097 #define u_int32_t uint32_t
00098 #define u_int16_t uint16_t
00099 #define u_int8_t uint8_t
00100 #endif
00101 #endif
00102 
00103 #ifndef SOCKLEN_T
00104 #define SOCKLEN_T int
00105 #endif
00106 
00107 #endif

Generated on Thu Feb 2 23:51:29 2012 for live by  doxygen 1.5.2