]>
The Tcpdump Group git mirrors - libpcap/blob - pcap-stdinc.h
2 * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
3 * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the Politecnico di Torino nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Copyright (C) 1999 WIDE Project.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the project nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
48 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * Avoids a compiler warning in case this was already defined
65 * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
66 * to prevent it from including 'winsock.h')
85 * VS 2013 or newer; we have <inttypes.h>.
89 #define u_int8_t uint8_t
90 #define u_int16_t uint16_t
91 #define u_int32_t uint32_t
92 #define u_int64_t uint64_t
95 * Earlier VS; we have to define this stuff ourselves.
98 typedef unsigned char u_int8_t
;
99 typedef signed char int8_t;
102 #ifndef HAVE_U_INT16_T
103 typedef unsigned short u_int16_t
;
104 typedef signed short int16_t;
107 #ifndef HAVE_U_INT32_T
108 typedef unsigned int u_int32_t
;
109 typedef signed int int32_t;
112 #ifndef HAVE_U_INT64_T
113 #ifdef _MSC_EXTENSIONS
114 typedef unsigned _int64 u_int64_t
;
115 typedef _int64
int64_t;
116 #else /* _MSC_EXTENSIONS */
117 typedef unsigned long long u_int64_t
;
118 typedef long long int64_t;
122 #elif defined(__MINGW32__)
127 * These may be defined by <inttypes.h>.
129 * XXX - for MSVC, we always want the _MSC_EXTENSIONS versions.
130 * What about other compilers? If, as the MinGW Web site says MinGW
131 * does, the other compilers just use Microsoft's run-time library,
132 * then they should probably use the _MSC_EXTENSIONS even if the
133 * compiler doesn't define _MSC_EXTENSIONS.
136 #ifdef _MSC_EXTENSIONS
137 #define PRId64 "I64d"
144 #ifdef _MSC_EXTENSIONS
145 #define PRIo64 "I64o"
152 #ifdef _MSC_EXTENSIONS
153 #define PRIx64 "I64x"
160 #ifdef _MSC_EXTENSIONS
161 #define PRIu64 "I64u"
168 #define strdup _strdup
171 #if !defined(__cplusplus)
172 #define inline __inline
175 #endif /* pcap_stdinc_h */