1 /*
2  * Copyright (C) 2005 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Android config -- "CYGWIN_NT-5.1".
19  *
20  * Cygwin has pthreads, but GDB seems to get confused if you use it to
21  * create threads.  By "confused", I mean it freezes up the first time the
22  * debugged process creates a thread, even if you use CreateThread.  The
23  * mere presence of pthreads linkage seems to cause problems.
24  */
25 #ifndef _ANDROID_CONFIG_H
26 #define _ANDROID_CONFIG_H
27 
28 /*
29  * ===========================================================================
30  *                              !!! IMPORTANT !!!
31  * ===========================================================================
32  *
33  * This file is included by ALL C/C++ source files.  Don't put anything in
34  * here unless you are absolutely certain it can't go anywhere else.
35  *
36  * Any C++ stuff must be wrapped with "#ifdef __cplusplus".  Do not use "//"
37  * comments.
38  */
39 
40 /* MingW doesn't define __BEGIN_DECLS / __END_DECLS. */
41 
42 #ifndef __BEGIN_DECLS
43 #  ifdef __cplusplus
44 #    define __BEGIN_DECLS extern "C" {
45 #  else
46 #    define __BEGIN_DECLS
47 #  endif
48 #endif
49 
50 #ifndef __END_DECLS
51 #  ifdef __cplusplus
52 #    define __END_DECLS }
53 #  else
54 #    define __END_DECLS
55 #  endif
56 #endif
57 
58 /*
59  * Threading model.  Choose one:
60  *
61  * HAVE_PTHREADS - use the pthreads library.
62  * HAVE_WIN32_THREADS - use Win32 thread primitives.
63  */
64 #define HAVE_WIN32_THREADS
65 
66 /*
67  * Do we have the futex syscall?
68  */
69 
70 /* #define HAVE_FUTEX */
71 
72 
73 /*
74  * Process creation model.  Choose one:
75  *
76  * HAVE_FORKEXEC - use fork() and exec()
77  * HAVE_WIN32_PROC - use CreateProcess()
78  */
79 #ifdef __CYGWIN__
80 #  define HAVE_FORKEXEC
81 #else
82 #  define HAVE_WIN32_PROC
83 #endif
84 
85 /*
86  * IPC model.  Choose one:
87  *
88  * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget).
89  * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap).
90  * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping).
91  * HAVE_ANDROID_IPC - use Android versions (?, mmap).
92  */
93 #define HAVE_WIN32_IPC
94 
95 /*
96  * Memory-mapping model. Choose one:
97  *
98  * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h
99  * HAVE_WIN32_FILEMAP - use Win32 filemaps
100  */
101 #ifdef __CYGWIN__
102 #define  HAVE_POSIX_FILEMAP
103 #else
104 #define  HAVE_WIN32_FILEMAP
105 #endif
106 
107 /*
108  * Define this if you have <termio.h>
109  */
110 #ifdef __CYGWIN__
111 #  define  HAVE_TERMIO_H
112 #endif
113 
114 /*
115  * Define this if you have <sys/sendfile.h>
116  */
117 #ifdef __CYGWIN__
118 #  define  HAVE_SYS_SENDFILE_H 1
119 #endif
120 
121 /*
122  * Define this if you build against MSVCRT.DLL
123  */
124 #ifndef __CYGWIN__
125 #  define HAVE_MS_C_RUNTIME
126 #endif
127 
128 /*
129  * Define this if you have sys/uio.h
130  */
131 #ifdef __CYGWIN__
132 #define  HAVE_SYS_UIO_H
133 #endif
134 
135 
136 /*
137  * Define this if we have localtime_r().
138  */
139 /* #define HAVE_LOCALTIME_R 1 */
140 
141 /*
142  * Define this if we have gethostbyname_r().
143  */
144 /* #define HAVE_GETHOSTBYNAME_R */
145 
146 /*
147  * Define this if we have ioctl().
148  */
149 /* #define HAVE_IOCTL */
150 
151 /*
152  * Define this if we want to use WinSock.
153  */
154 #ifndef __CYGWIN__
155 #define HAVE_WINSOCK
156 #endif
157 
158 /*
159  * Define this if your platforms implements symbolic links
160  * in its filesystems
161  */
162 /* #define HAVE_SYMLINKS */
163 
164 /*
165  * Define this if have clock_gettime() and friends
166  */
167 /* #define HAVE_POSIX_CLOCKS */
168 
169 /*
170  * Endianness of the target machine.  Choose one:
171  *
172  * HAVE_ENDIAN_H -- have endian.h header we can include.
173  * HAVE_LITTLE_ENDIAN -- we are little endian.
174  * HAVE_BIG_ENDIAN -- we are big endian.
175  */
176 #ifdef __CYGWIN__
177 #define HAVE_ENDIAN_H
178 #endif
179 
180 #define HAVE_LITTLE_ENDIAN
181 
182 /*
183  * We need to choose between 32-bit and 64-bit off_t.  All of our code should
184  * agree on the same size.  For desktop systems, use 64-bit values,
185  * because some of our libraries (e.g. wxWidgets) expect to be built that way.
186  */
187 #define _FILE_OFFSET_BITS 64
188 #define _LARGEFILE_SOURCE 1
189 
190 /*
191  * Define if platform has off64_t (and lseek64 and other xxx64 functions)
192  */
193 #define HAVE_OFF64_T
194 
195 /*
196  * Defined if we have the backtrace() call for retrieving a stack trace.
197  * Needed for CallStack to operate; if not defined, CallStack is
198  * non-functional.
199  */
200 #define HAVE_BACKTRACE 0
201 
202 /*
203  * Defined if we have the cxxabi.h header for demangling C++ symbols.  If
204  * not defined, stack crawls will be displayed with raw mangled symbols
205  */
206 #define HAVE_CXXABI 0
207 
208 /*
209  * Define if tm struct has tm_gmtoff field
210  */
211 /* #define HAVE_TM_GMTOFF 1 */
212 
213 /*
214  * Define if dirent struct has d_type field
215  */
216 /* #define HAVE_DIRENT_D_TYPE 1 */
217 
218 /*
219  * Define if libc includes Android system properties implementation.
220  */
221 /* #define HAVE_LIBC_SYSTEM_PROPERTIES */
222 
223 /*
224  * Define if system provides a system property server (should be
225  * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
226  */
227 /* #define HAVE_SYSTEM_PROPERTY_SERVER */
228 
229 /*
230  * Define if we have madvise() in <sys/mman.h>
231  */
232 /*#define HAVE_MADVISE 1*/
233 
234 /*
235  * Add any extra platform-specific defines here.
236  */
237 #define WIN32 1                 /* stock Cygwin doesn't define these */
238 #define _WIN32 1
239 #define _WIN32_WINNT 0x0500     /* admit to using >= Win2K */
240 
241 #define HAVE_WINDOWS_PATHS      /* needed by simulator */
242 
243 /*
244  * What CPU architecture does this platform use?
245  */
246 #define ARCH_X86
247 
248 /*
249  * sprintf() format string for shared library naming.
250  */
251 #define OS_SHARED_LIB_FORMAT_STR    "lib%s.dll"
252 
253 /*
254  * type for the third argument to mincore().
255  */
256 #define MINCORE_POINTER_TYPE unsigned char *
257 
258 /*
259  * The default path separator for the platform
260  */
261 #define OS_PATH_SEPARATOR '\\'
262 
263 /*
264  * Is the filesystem case sensitive?
265  */
266 /* #define OS_CASE_SENSITIVE */
267 
268 /*
269  * Define if <sys/socket.h> exists.
270  * Cygwin has it, but not MinGW.
271  */
272 #ifdef USE_MINGW
273 /* #define HAVE_SYS_SOCKET_H */
274 #else
275 #define HAVE_SYS_SOCKET_H 1
276 #endif
277 
278 /*
279  * Define if the strlcpy() function exists on the system.
280  */
281 /* #define HAVE_STRLCPY 1 */
282 
283 /*
284  * Define if the open_memstream() function exists on the system.
285  */
286 /* #define HAVE_OPEN_MEMSTREAM 1 */
287 
288 /*
289  * Define if the BSD funopen() function exists on the system.
290  */
291 /* #define HAVE_FUNOPEN 1 */
292 
293 /*
294  * Define if <winsock2.h> exists.
295  * Only MinGW has it.
296  */
297 #ifdef USE_MINGW
298 #define HAVE_WINSOCK2_H 1
299 #else
300 /* #define HAVE_WINSOCK2_H */
301 #endif
302 
303 /*
304  * Various definitions missing in MinGW
305  */
306 #ifdef USE_MINGW
307 #define S_IRGRP 0
308 #endif
309 
310 /*
311  * Define if writev() exists.
312  */
313 /* #define HAVE_WRITEV */
314 
315 /*
316  * Define if <stdint.h> exists.
317  */
318 /* #define HAVE_STDINT_H */
319 
320 /*
321  * Define if <stdbool.h> exists.
322  */
323 #define HAVE_STDBOOL_H
324 
325 /*
326  * Define if <sched.h> exists.
327  */
328 /* #define HAVE_SCHED_H */
329 
330 /*
331  * Define if pread() exists
332  */
333 /* #define HAVE_PREAD 1 */
334 
335 /*
336  * Define if we have st_mtim in struct stat
337  */
338 /* #define HAVE_STAT_ST_MTIM 1 */
339 
340 /*
341  * Define if printf() supports %zd for size_t arguments
342  */
343 /* #define HAVE_PRINTF_ZD 1 */
344 
345 /*
346  * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
347  */
348 #define HAVE_BSD_QSORT_R 0
349 
350 /*
351  * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
352  */
353 #define HAVE_GNU_QSORT_R 0
354 
355 #endif /*_ANDROID_CONFIG_H*/
356