1 /* $NetBSD: pcap-stdinc.h,v 1.2 2014/11/19 19:33:30 christos Exp $ */ 2 3 /* 4 * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy) 5 * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California) 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 3. Neither the name of the Politecnico di Torino nor the names of its 18 * contributors may be used to endorse or promote products derived from 19 * this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 #ifndef pcap_stdinc_h 34 #define pcap_stdinc_h 35 36 /* 37 * Avoids a compiler warning in case this was already defined 38 * (someone defined _WINSOCKAPI_ when including 'windows.h', in order 39 * to prevent it from including 'winsock.h') 40 */ 41 #ifdef _WINSOCKAPI_ 42 #undef _WINSOCKAPI_ 43 #endif 44 45 #include <winsock2.h> 46 #include <fcntl.h> 47 #include <time.h> 48 #include <io.h> 49 50 #include "bittypes.h" 51 #include "IP6_misc.h" 52 53 #define caddr_t char* 54 55 #if defined(_MSC_VER) 56 #define snprintf _snprintf 57 #define vsnprintf _vsnprintf 58 #define strdup _strdup 59 #endif 60 61 #define inline __inline 62 63 #ifdef __MINGW32__ 64 #include <stdint.h> 65 #else 66 #ifndef _UINTPTR_T_DEFINED 67 #ifdef _WIN64 68 typedef unsigned __int64 uintptr_t; 69 #else 70 typedef _W64 unsigned int uintptr_t; 71 #endif 72 #define _UINTPTR_T_DEFINED 73 #endif 74 75 #ifndef _INTPTR_T_DEFINED 76 #ifdef _WIN64 77 typedef __int64 intptr_t; 78 #else 79 typedef _W64 int intptr_t; 80 #endif 81 #define _INTPTR_T_DEFINED 82 #endif 83 #endif /*__MINGW32__*/ 84 85 #endif /* pcap_stdinc_h */ 86