1127664Sbms/*
2214518Srpaulo * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
3214518Srpaulo * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
4127664Sbms * All rights reserved.
5127664Sbms *
6127664Sbms * Redistribution and use in source and binary forms, with or without
7127664Sbms * modification, are permitted provided that the following conditions
8127664Sbms * are met:
9127664Sbms *
10127664Sbms * 1. Redistributions of source code must retain the above copyright
11127664Sbms * notice, this list of conditions and the following disclaimer.
12127664Sbms * 2. Redistributions in binary form must reproduce the above copyright
13127664Sbms * notice, this list of conditions and the following disclaimer in the
14127664Sbms * documentation and/or other materials provided with the distribution.
15127664Sbms * 3. Neither the name of the Politecnico di Torino nor the names of its
16127664Sbms * contributors may be used to endorse or promote products derived from
17127664Sbms * this software without specific prior written permission.
18127664Sbms *
19127664Sbms * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20127664Sbms * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21127664Sbms * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22127664Sbms * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23127664Sbms * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24127664Sbms * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25127664Sbms * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26127664Sbms * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27127664Sbms * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28127664Sbms * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29127664Sbms * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30127664Sbms *
31190225Srpaulo * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL)
32127664Sbms */
33214518Srpaulo#ifndef pcap_stdinc_h
34214518Srpaulo#define pcap_stdinc_h
35127664Sbms
36127664Sbms/*
37127664Sbms * Avoids a compiler warning in case this was already defined
38127664Sbms * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
39127664Sbms * to prevent it from including 'winsock.h')
40127664Sbms */
41127664Sbms#ifdef _WINSOCKAPI_
42127664Sbms#undef _WINSOCKAPI_
43127664Sbms#endif
44127664Sbms#include <winsock2.h>
45127664Sbms
46127664Sbms#include <fcntl.h>
47127664Sbms
48127664Sbms#include "bittypes.h"
49127664Sbms#include <time.h>
50127664Sbms#include <io.h>
51127664Sbms
52127664Sbms#ifndef __MINGW32__
53127664Sbms#include "IP6_misc.h"
54127664Sbms#endif
55127664Sbms
56127664Sbms#define caddr_t char*
57127664Sbms
58214518Srpaulo#if _MSC_VER < 1500
59127664Sbms#define snprintf _snprintf
60127664Sbms#define vsnprintf _vsnprintf
61190225Srpaulo#define strdup _strdup
62214518Srpaulo#endif
63214518Srpaulo
64127664Sbms#define inline __inline
65190225Srpaulo
66190225Srpaulo#ifdef __MINGW32__
67190225Srpaulo#include <stdint.h>
68190225Srpaulo#else /*__MINGW32__*/
69190225Srpaulo/* MSVC compiler */
70190225Srpaulo#ifndef _UINTPTR_T_DEFINED
71190225Srpaulo#ifdef  _WIN64
72190225Srpaulotypedef unsigned __int64    uintptr_t;
73190225Srpaulo#else
74190225Srpaulotypedef _W64 unsigned int   uintptr_t;
75190225Srpaulo#endif
76190225Srpaulo#define _UINTPTR_T_DEFINED
77190225Srpaulo#endif
78190225Srpaulo
79190225Srpaulo#ifndef _INTPTR_T_DEFINED
80190225Srpaulo#ifdef  _WIN64
81190225Srpaulotypedef __int64    intptr_t;
82190225Srpaulo#else
83190225Srpaulotypedef _W64 int   intptr_t;
84190225Srpaulo#endif
85190225Srpaulo#define _INTPTR_T_DEFINED
86190225Srpaulo#endif
87190225Srpaulo
88190225Srpaulo#endif /*__MINGW32__*/
89214518Srpaulo#endif /* pcap_stdinc_h */
90