]>
Commit | Line | Data |
---|---|---|
1 | #ifndef CYGUTILS_COMMON_H | |
2 | #define CYGUTILS_COMMON_H 1 | |
3 | ||
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 | ||
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> | |
27 | #endif /* HAVE_SYS_TYPES_H */ | |
28 | #if HAVE_SYS_STAT_H | |
29 | # include <sys/stat.h> | |
30 | #endif /* HAVE_SYS_STAT_H */ | |
31 | #if STDC_HEADERS | |
32 | # include <stdlib.h> | |
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 | |
44 | # include <string.h> | |
45 | #elif HAVE_STRINGS_H | |
46 | # include <strings.h> | |
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 */ | |
72 | ||
73 | #if HAVE_UNISTD_H | |
74 | # include <unistd.h> | |
75 | #endif /*HAVE_UNISTD_H*/ | |
76 | ||
77 | #if HAVE_SYS_PARAM_H | |
78 | # include <sys/param.h> | |
79 | #endif /*HAVE_SYS_PARAM_H */ | |
80 | ||
81 | #if HAVE_ERRNO_H | |
82 | # include <errno.h> | |
83 | #endif /*HAVE_ERRNO_H*/ | |
84 | ||
85 | #if HAVE_FCNTL_H | |
86 | # include <fcntl.h> | |
87 | #endif /*HAVE_FCNTL_H*/ | |
88 | ||
89 | #if HAVE_LIMITS_H | |
90 | # include <limits.h> | |
91 | #endif /*HAVE_LIMITS_H*/ | |
92 | ||
93 | #if HAVE_MALLOC_H | |
94 | # include <malloc.h> | |
95 | #endif /*HAVE_MALLOC_H*/ | |
96 | ||
97 | #if HAVE_CTYPE_H | |
98 | # include <ctype.h> | |
99 | #endif /*HAVE_CTYPE_H*/ | |
100 | ||
101 | #if HAVE_GETOPT_H | |
102 | # include <getopt.h> | |
103 | #endif /*HAVE_GETOPT_H*/ | |
104 | ||
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 | ||
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 | ||
129 | /* we don't include wchar.h or wctype.h here. let widechar.h do that */ | |
130 | ||
131 | #if defined(_WIN32) && !defined(__CYGWIN__) | |
132 | ||
133 | #define cygwin_conv_to_win32_path(a,b) strncpy(b,a,MAX_PATH) | |
134 | #define cygwin_conv_to_full_win32_path(a,b) _fullpath(b,a,MAX_PATH) | |
135 | #define cygwin_conv_to_full_posix_path(a,b) _fullpath(b,a,MAX_PATH) | |
136 | ||
137 | ||
138 | #endif /* _WIN32 && !__CYGWIN__ */ | |
139 | ||
140 | #endif /* !CYGUTILS_COMMON_H */ | |
141 |