]>
Commit | Line | Data |
---|---|---|
d2b03e6a CW |
1 | #ifndef CYGUTILS_COMMON_H |
2 | #define CYGUTILS_COMMON_H 1 | |
3 | ||
c09847dc CW |
4 | #if defined(_WIN32) || defined(__WIN32) || defined(WIN32) || defined(__WIN32__) |
5 | # ifndef WIN32 | |
6 | # define WIN32 1 | |
7 | # endif | |
8 | # ifndef _WIN32 | |
9 | # define _WIN32 1 | |
10 | # endif | |
11 | # ifndef __WIN32 | |
12 | # define __WIN32 1 | |
13 | # endif | |
14 | # ifndef __WIN32__ | |
15 | # define __WIN32__ 1 | |
16 | # endif | |
17 | #endif | |
18 | ||
d2b03e6a CW |
19 | #if HAVE_CONFIG_H |
20 | # include <config.h> | |
21 | #endif | |
22 | ||
23 | #include <stdio.h> | |
24 | ||
25 | #if HAVE_SYS_TYPES_H | |
26 | # include <sys/types.h> | |
bd695173 CW |
27 | #endif /* HAVE_SYS_TYPES_H */ |
28 | #if HAVE_SYS_STAT_H | |
29 | # include <sys/stat.h> | |
30 | #endif /* HAVE_SYS_STAT_H */ | |
d2b03e6a CW |
31 | #if STDC_HEADERS |
32 | # include <stdlib.h> | |
bd695173 CW |
33 | # include <stddef.h> |
34 | #else | |
35 | # if HAVE_STDLIB_H | |
36 | # include <stdlib.h> | |
37 | # endif | |
38 | #endif /*STDC_HEADERS*/ | |
39 | ||
40 | #if HAVE_STRING_H | |
41 | # if !STDC_HEADERS && HAVE_MEMORY_H | |
42 | # include <memory.h> | |
43 | # endif | |
d2b03e6a CW |
44 | # include <string.h> |
45 | #elif HAVE_STRINGS_H | |
46 | # include <strings.h> | |
bd695173 CW |
47 | #endif /*HAVE_STRING[S]_H*/ |
48 | ||
49 | #if HAVE_STDARG_H | |
50 | # include <stdarg.h> | |
51 | # define VA_START(a, f) va_start(a, f) | |
52 | #else | |
53 | # if HAVE_VARARGS_H | |
54 | # include <varargs.h> | |
55 | # define VA_START(a, f) va_start(a) | |
56 | # endif | |
57 | #endif | |
58 | #ifndef VA_START | |
59 | error no variadic api | |
60 | #endif /* VARIADIC */ | |
61 | ||
62 | #if TIME_WITH_SYS_TIME | |
63 | # include <sys/time.h> | |
64 | # include <time.h> | |
65 | #else | |
66 | # if HAVE_SYS_TIME_H | |
67 | # include <sys/time.h> | |
68 | # else | |
69 | # include <time.h> | |
70 | # endif | |
71 | #endif /* TIME */ | |
d2b03e6a CW |
72 | |
73 | #if HAVE_UNISTD_H | |
74 | # include <unistd.h> | |
75 | #endif /*HAVE_UNISTD_H*/ | |
76 | ||
bd695173 CW |
77 | #if HAVE_SYS_PARAM_H |
78 | # include <sys/param.h> | |
79 | #endif /*HAVE_SYS_PARAM_H */ | |
80 | ||
d2b03e6a CW |
81 | #if HAVE_ERRNO_H |
82 | # include <errno.h> | |
83 | #endif /*HAVE_ERRNO_H*/ | |
84 | ||
bd695173 CW |
85 | #if HAVE_FCNTL_H |
86 | # include <fcntl.h> | |
87 | #endif /*HAVE_FCNTL_H*/ | |
d2b03e6a CW |
88 | |
89 | #if HAVE_LIMITS_H | |
90 | # include <limits.h> | |
91 | #endif /*HAVE_LIMITS_H*/ | |
92 | ||
bd695173 CW |
93 | #if HAVE_MALLOC_H |
94 | # include <malloc.h> | |
2cacf0ee | 95 | #endif /*HAVE_MALLOC_H*/ |
bd695173 | 96 | |
bd695173 CW |
97 | #if HAVE_CTYPE_H |
98 | # include <ctype.h> | |
2cacf0ee CW |
99 | #endif /*HAVE_CTYPE_H*/ |
100 | ||
bd695173 CW |
101 | #if HAVE_GETOPT_H |
102 | # include <getopt.h> | |
2cacf0ee | 103 | #endif /*HAVE_GETOPT_H*/ |
bd695173 | 104 | |
67358361 CW |
105 | /* column needs TIOCGWINSZ */ |
106 | #if HAVE_TERMIOS_H | |
107 | # include <termios.h> | |
108 | #endif | |
109 | ||
110 | #if GWINSZ_IN_SYS_IOCTL | |
111 | # include <sys/ioctl.h> | |
112 | #endif | |
113 | /* End: column needs TIOCGWINSZ */ | |
114 | ||
115 | ||
d2b03e6a CW |
116 | #if HAVE_POPT_H |
117 | # include <popt.h> | |
118 | #endif /*HAVE_POPT_H*/ | |
119 | ||
120 | #if HAVE_WINDOWS_H | |
121 | # include <windows.h> | |
122 | #else | |
123 | # ifndef O_BINARY | |
124 | # define O_BINARY 0 | |
125 | # endif | |
126 | # define setmode(a, b) | |
127 | #endif /*HAVE_WINDOWS_H*/ | |
128 | ||
bd695173 CW |
129 | /* we don't include wchar.h or wctype.h here. let widechar.h do that */ |
130 | ||
d2b03e6a CW |
131 | #endif /* !CYGUTILS_COMMON_H */ |
132 |