Remove checks for headers and functions that are in C99.
[tinc] / src / have.h
1 /*
2     have.h -- include headers which are known to exist
3     Copyright (C) 1998-2005 Ivo Timmermans
4                   2003-2013 Guus Sliepen <guus@tinc-vpn.org>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License along
17     with this program; if not, write to the Free Software Foundation, Inc.,
18     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef __TINC_HAVE_H__
22 #define __TINC_HAVE_H__
23
24 #ifdef HAVE_MINGW
25 #ifdef WITH_WINDOWS2000
26 #define WINVER Windows2000
27 #else
28 #define WINVER WindowsXP
29 #endif
30 #define WIN32_LEAN_AND_MEAN
31 #endif
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <stdarg.h>
36 #include <stdbool.h>
37 #include <string.h>
38 #include <ctype.h>
39 #include <signal.h>
40 #include <errno.h>
41 #include <fcntl.h>
42 #include <unistd.h>
43 #include <limits.h>
44 #include <math.h>
45 #include <time.h>
46
47 #ifdef HAVE_MINGW
48 #include <w32api.h>
49 #include <winsock2.h>
50 #include <windows.h>
51 #include <ws2tcpip.h>
52 #endif
53
54 #ifdef HAVE_TERMIOS_H
55 #include <termios.h>
56 #endif
57
58 #ifdef HAVE_INTTYPES_H
59 #include <inttypes.h>
60 #endif
61
62 /* Include system specific headers */
63
64 #ifdef HAVE_SYSLOG_H
65 #include <syslog.h>
66 #endif
67
68 #ifdef HAVE_SYS_TIME_H
69 #include <sys/time.h>
70 #endif
71
72
73 #ifdef HAVE_SYS_TYPES_H
74 #include <sys/types.h>
75 #endif
76
77 #ifdef HAVE_SYS_STAT_H
78 #include <sys/stat.h>
79 #endif
80
81 #ifdef HAVE_SYS_FILE_H
82 #include <sys/file.h>
83 #endif
84
85 #ifdef HAVE_SYS_WAIT_H
86 #include <sys/wait.h>
87 #endif
88
89 #ifdef HAVE_SYS_IOCTL_H
90 #include <sys/ioctl.h>
91 #endif
92
93 #ifdef HAVE_SYS_PARAM_H
94 #include <sys/param.h>
95 #endif
96
97 #ifdef HAVE_SYS_RESOURCE_H
98 #include <sys/resource.h>
99 #endif
100
101 #ifdef HAVE_SYS_UN_H
102 #include <sys/un.h>
103 #endif
104
105 #ifdef HAVE_DIRENT_H
106 #include <dirent.h>
107 #endif
108
109 /* SunOS really wants sys/socket.h BEFORE net/if.h,
110    and FreeBSD wants these lines below the rest. */
111
112 #ifdef HAVE_NETDB_H
113 #include <netdb.h>
114 #endif
115
116 #ifdef HAVE_SYS_SOCKET_H
117 #include <sys/socket.h>
118 #endif
119
120 #ifdef HAVE_NET_IF_H
121 #include <net/if.h>
122 #endif
123
124 #ifdef HAVE_NET_IF_TYPES_H
125 #include <net/if_types.h>
126 #endif
127
128 #ifdef HAVE_NET_IF_TUN_H
129 #include <net/if_tun.h>
130 #endif
131
132 #ifdef HAVE_NET_TUN_IF_TUN_H
133 #include <net/tun/if_tun.h>
134 #endif
135
136 #ifdef HAVE_NET_IF_TAP_H
137 #include <net/if_tap.h>
138 #endif
139
140 #ifdef HAVE_NET_TAP_IF_TAP_H
141 #include <net/tap/if_tap.h>
142 #endif
143
144 #ifdef HAVE_NETINET_IN_SYSTM_H
145 #include <netinet/in_systm.h>
146 #endif
147
148 #ifdef HAVE_NETINET_IN_H
149 #include <netinet/in.h>
150 #endif
151
152 #ifdef HAVE_ARPA_INET_H
153 #include <arpa/inet.h>
154 #endif
155
156 #ifdef HAVE_NETINET_IP_H
157 #include <netinet/ip.h>
158 #endif
159
160 #ifdef HAVE_NETINET_TCP_H
161 #include <netinet/tcp.h>
162 #endif
163
164 #ifdef HAVE_NETINET_IN6_H
165 #include <netinet/in6.h>
166 #endif
167
168 #ifdef HAVE_NETINET_IP6_H
169 #include <netinet/ip6.h>
170 #endif
171
172 #ifdef HAVE_NET_ETHERNET_H
173 #include <net/ethernet.h>
174 #endif
175
176 #ifdef HAVE_NET_IF_ARP_H
177 #include <net/if_arp.h>
178 #endif
179
180 #ifdef HAVE_NETINET_IP_ICMP_H
181 #include <netinet/ip_icmp.h>
182 #endif
183
184 #ifdef HAVE_NETINET_ICMP6_H
185 #include <netinet/icmp6.h>
186 #endif
187
188 #ifdef HAVE_NETINET_IF_ETHER_H
189 #include <netinet/if_ether.h>
190 #endif
191
192 #ifdef HAVE_ARPA_NAMESER_H
193 #include <arpa/nameser.h>
194 #endif
195
196 #ifdef HAVE_RESOLV_H
197 #include <resolv.h>
198 #endif
199
200 #ifdef HAVE_LINUX_IF_TUN_H
201 #include <linux/if_tun.h>
202 #endif
203
204 #ifdef HAVE_GETOPT_H
205 #include <getopt.h>
206 #else
207 #include "getopt.h"
208 #endif
209
210 #ifdef STATUS
211 #undef STATUS
212 #endif
213
214 #ifdef HAVE_MINGW
215 #define SLASH "\\"
216 #else
217 #define SLASH "/"
218 #endif
219
220 #endif /* __TINC_SYSTEM_H__ */