5 have.h -- include headers which are known to exist
6 Copyright (C) 1998-2005 Ivo Timmermans
7 2003-2021 Guus Sliepen <guus@tinc-vpn.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #define _WIN32_WINNT 0x0600
27 #define WIN32_LEAN_AND_MEAN
28 #define _CRT_SECURE_NO_WARNINGS
29 #define _CRT_NONSTDC_NO_WARNINGS
48 #ifdef HAVE_STATIC_ASSERT
49 #define STATIC_ASSERT(expr, msg) _Static_assert((expr), msg)
51 #define STATIC_ASSERT(check, msg)
56 #elif defined(HAVE_NETBSD)
57 #define alloca(size) __builtin_alloca(size)
74 #endif // HAVE_WINDOWS
80 #ifdef HAVE_INTTYPES_H
84 /* Include system specific headers */
94 #ifdef HAVE_SYS_TIME_H
99 #ifdef HAVE_SYS_TYPES_H
100 #include <sys/types.h>
103 #ifdef HAVE_SYS_STAT_H
104 #include <sys/stat.h>
107 #ifdef HAVE_SYS_FILE_H
108 #include <sys/file.h>
111 #ifdef HAVE_SYS_MMAN_H
112 #include <sys/mman.h>
115 #ifdef HAVE_SYS_WAIT_H
116 #include <sys/wait.h>
119 #ifdef HAVE_SYS_IOCTL_H
120 #include <sys/ioctl.h>
123 #ifdef HAVE_SYS_PARAM_H
124 #include <sys/param.h>
127 #ifdef HAVE_SYS_RESOURCE_H
128 #include <sys/resource.h>
137 #elif defined(_MSC_VER)
141 /* SunOS really wants sys/socket.h BEFORE net/if.h,
142 and FreeBSD wants these lines below the rest. */
148 #ifdef HAVE_SYS_SOCKET_H
149 #include <sys/socket.h>
156 #ifdef HAVE_NET_IF_TYPES_H
157 #include <net/if_types.h>
160 #ifdef HAVE_NET_IF_TUN_H
161 #include <net/if_tun.h>
164 #ifdef HAVE_NET_TUN_IF_TUN_H
165 #include <net/tun/if_tun.h>
168 #ifdef HAVE_NET_IF_TAP_H
169 #include <net/if_tap.h>
172 #ifdef HAVE_NET_TAP_IF_TAP_H
173 #include <net/tap/if_tap.h>
176 #ifdef HAVE_NETINET_IN_SYSTM_H
177 #include <netinet/in_systm.h>
180 #ifdef HAVE_NETINET_IN_H
181 #include <netinet/in.h>
184 #ifdef HAVE_ARPA_INET_H
185 #include <arpa/inet.h>
188 #ifdef HAVE_NETINET_IP_H
189 #include <netinet/ip.h>
192 #ifdef HAVE_NETINET_TCP_H
193 #include <netinet/tcp.h>
196 #ifdef HAVE_NETINET_IN6_H
197 #include <netinet/in6.h>
200 #ifdef HAVE_NETINET_IP6_H
201 #include <netinet/ip6.h>
204 #ifdef HAVE_NET_ETHERNET_H
205 #include <net/ethernet.h>
208 #ifdef HAVE_NET_IF_ARP_H
209 #include <net/if_arp.h>
212 #ifdef HAVE_NETINET_IP_ICMP_H
213 #include <netinet/ip_icmp.h>
216 #ifdef HAVE_NETINET_ICMP6_H
217 #include <netinet/icmp6.h>
220 #ifdef HAVE_NETINET_IF_ETHER_H
221 #include <netinet/if_ether.h>
224 #ifdef HAVE_ARPA_NAMESER_H
225 #include <arpa/nameser.h>
232 #ifdef HAVE_LINUX_IF_TUN_H
233 #include <linux/if_tun.h>