]> git.meshlink.io Git - meshlink/blob - src/have.h
Use atomic operations to check whether to write to the signal pipe.
[meshlink] / src / have.h
1 #ifndef MESHLINK_HAVE_H
2 #define MESHLINK_HAVE_H
3
4 /*
5     have.h -- include headers which are known to exist
6     Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
7
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License along
19     with this program; if not, write to the Free Software Foundation, Inc.,
20     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23 #ifdef HAVE_MINGW
24 #ifdef WITH_WINDOWS2000
25 #define WINVER Windows2000
26 #else
27 #define WINVER WindowsXP
28 #endif
29 #define WIN32_LEAN_AND_MEAN
30 #endif
31
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <stdarg.h>
35 #include <stdatomic.h>
36 #include <stdbool.h>
37 #include <stdint.h>
38 #include <inttypes.h>
39 #include <string.h>
40 #include <ctype.h>
41 #include <signal.h>
42 #include <errno.h>
43 #include <fcntl.h>
44 #include <unistd.h>
45 #include <limits.h>
46 #include <assert.h>
47
48 #ifdef HAVE_MINGW
49 #include <w32api.h>
50 #include <winsock2.h>
51 #include <windows.h>
52 #include <ws2tcpip.h>
53 #endif
54
55 #ifdef HAVE_TERMIOS_H
56 #include <termios.h>
57 #endif
58
59 /* Include system specific headers */
60
61 #ifdef HAVE_SYSLOG_H
62 #include <syslog.h>
63 #endif
64
65 #ifdef HAVE_SYS_TIME_H
66 #include <sys/time.h>
67 #endif
68
69 #ifdef HAVE_TIME_H
70 #include <time.h>
71 #endif
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_PARAM_H
90 #include <sys/param.h>
91 #endif
92
93 #ifdef HAVE_SYS_RESOURCE_H
94 #include <sys/resource.h>
95 #endif
96
97 #ifdef HAVE_SYS_UN_H
98 #include <sys/un.h>
99 #endif
100
101 #ifdef HAVE_DIRENT_H
102 #include <dirent.h>
103 #endif
104
105 /* SunOS really wants sys/socket.h BEFORE net/if.h,
106    and FreeBSD wants these lines below the rest. */
107
108 #ifdef HAVE_NETDB_H
109 #include <netdb.h>
110 #endif
111
112 #ifdef HAVE_SYS_SOCKET_H
113 #include <sys/socket.h>
114 #endif
115
116 #ifdef HAVE_ARPA_INET_H
117 #include <arpa/inet.h>
118 #endif
119
120 #ifdef HAVE_IFADDRS_H
121 #include <ifaddrs.h>
122 #endif
123
124 #ifdef HAVE_MINGW
125 #define SLASH "\\"
126 #else
127 #define SLASH "/"
128 #endif
129
130 #endif