AndroidConfig.h revision 1e47832909606ae3cbd0169ec48956b5c8fdea4f
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/*
41 * Threading model.  Choose one:
42 *
43 * HAVE_PTHREADS - use the pthreads library.
44 * HAVE_WIN32_THREADS - use Win32 thread primitives.
45 */
46#define HAVE_WIN32_THREADS
47
48/*
49 * Do we have the futex syscall?
50 */
51
52/* #define HAVE_FUTEX */
53
54
55/*
56 * Process creation model.  Choose one:
57 *
58 * HAVE_FORKEXEC - use fork() and exec()
59 * HAVE_WIN32_PROC - use CreateProcess()
60 */
61#ifdef __CYGWIN__
62#  define HAVE_FORKEXEC
63#else
64#  define HAVE_WIN32_PROC
65#endif
66
67/*
68 * Process out-of-memory adjustment.  Set if running on Linux,
69 * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory
70 * badness adjustment.
71 */
72/* #define HAVE_OOM_ADJ */
73
74/*
75 * IPC model.  Choose one:
76 *
77 * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget).
78 * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap).
79 * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping).
80 * HAVE_ANDROID_IPC - use Android versions (?, mmap).
81 */
82#define HAVE_WIN32_IPC
83
84/*
85 * Memory-mapping model. Choose one:
86 *
87 * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h
88 * HAVE_WIN32_FILEMAP - use Win32 filemaps
89 */
90#ifdef __CYGWIN__
91#define  HAVE_POSIX_FILEMAP
92#else
93#define  HAVE_WIN32_FILEMAP
94#endif
95
96/*
97 * Define this if you have <termio.h>
98 */
99#ifdef __CYGWIN__
100#  define  HAVE_TERMIO_H
101#endif
102
103/*
104 * Define this if you have <sys/sendfile.h>
105 */
106#ifdef __CYGWIN__
107#  define  HAVE_SYS_SENDFILE_H 1
108#endif
109
110/*
111 * Define this if you build against MSVCRT.DLL
112 */
113#ifndef __CYGWIN__
114#  define HAVE_MS_C_RUNTIME
115#endif
116
117/*
118 * Define this if you have sys/uio.h
119 */
120#ifdef __CYGWIN__
121#define  HAVE_SYS_UIO_H
122#endif
123
124
125/*
126 * Define this if we have localtime_r().
127 */
128/* #define HAVE_LOCALTIME_R */
129
130/*
131 * Define this if we have gethostbyname_r().
132 */
133/* #define HAVE_GETHOSTBYNAME_R */
134
135/*
136 * Define this if we have ioctl().
137 */
138/* #define HAVE_IOCTL */
139
140/*
141 * Define this if we want to use WinSock.
142 */
143#ifndef __CYGWIN__
144#define HAVE_WINSOCK
145#endif
146
147/*
148 * Define this if your platforms implements symbolic links
149 * in its filesystems
150 */
151/* #define HAVE_SYMLINKS */
152
153/*
154 * Define this if have clock_gettime() and friends
155 */
156/* #define HAVE_POSIX_CLOCKS */
157
158/*
159 * Endianness of the target machine.  Choose one:
160 *
161 * HAVE_ENDIAN_H -- have endian.h header we can include.
162 * HAVE_LITTLE_ENDIAN -- we are little endian.
163 * HAVE_BIG_ENDIAN -- we are big endian.
164 */
165#ifdef __CYGWIN__
166#define HAVE_ENDIAN_H
167#endif
168
169#define HAVE_LITTLE_ENDIAN
170
171/*
172 * We need to choose between 32-bit and 64-bit off_t.  All of our code should
173 * agree on the same size.  For desktop systems, use 64-bit values,
174 * because some of our libraries (e.g. wxWidgets) expect to be built that way.
175 */
176#define _FILE_OFFSET_BITS 64
177#define _LARGEFILE_SOURCE 1
178
179/*
180 * Define if platform has off64_t (and lseek64 and other xxx64 functions)
181 */
182#define HAVE_OFF64_T
183
184/*
185 * Defined if we have the backtrace() call for retrieving a stack trace.
186 * Needed for CallStack to operate; if not defined, CallStack is
187 * non-functional.
188 */
189#define HAVE_BACKTRACE 0
190
191/*
192 * Defined if we have the dladdr() call for retrieving the symbol associated
193 * with a memory address.  If not defined, stack crawls will not have symbolic
194 * information.
195 */
196#define HAVE_DLADDR 0
197
198/*
199 * Defined if we have the cxxabi.h header for demangling C++ symbols.  If
200 * not defined, stack crawls will be displayed with raw mangled symbols
201 */
202#define HAVE_CXXABI 0
203
204/*
205 * Define if tm struct has tm_gmtoff field
206 */
207/* #define HAVE_TM_GMTOFF 1 */
208
209/*
210 * Define if dirent struct has d_type field
211 */
212/* #define HAVE_DIRENT_D_TYPE 1 */
213
214/*
215 * Define if libc includes Android system properties implementation.
216 */
217/* #define HAVE_LIBC_SYSTEM_PROPERTIES */
218
219/*
220 * Define if system provides a system property server (should be
221 * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
222 */
223/* #define HAVE_SYSTEM_PROPERTY_SERVER */
224
225/*
226 * Define if we have madvise() in <sys/mman.h>
227 */
228/*#define HAVE_MADVISE 1*/
229
230/*
231 * Add any extra platform-specific defines here.
232 */
233#define WIN32 1                 /* stock Cygwin doesn't define these */
234#define _WIN32 1
235#define _WIN32_WINNT 0x0500     /* admit to using >= Win2K */
236
237#define HAVE_WINDOWS_PATHS      /* needed by simulator */
238
239/*
240 * What CPU architecture does this platform use?
241 */
242#define ARCH_X86
243
244/*
245 * sprintf() format string for shared library naming.
246 */
247#define OS_SHARED_LIB_FORMAT_STR    "lib%s.dll"
248
249/*
250 * type for the third argument to mincore().
251 */
252#define MINCORE_POINTER_TYPE unsigned char *
253
254/*
255 * The default path separator for the platform
256 */
257#define OS_PATH_SEPARATOR '\\'
258
259/*
260 * Is the filesystem case sensitive?
261 */
262/* #define OS_CASE_SENSITIVE */
263
264/*
265 * Define if <sys/socket.h> exists.
266 * Cygwin has it, but not MinGW.
267 */
268#ifdef USE_MINGW
269/* #define HAVE_SYS_SOCKET_H */
270#else
271#define HAVE_SYS_SOCKET_H 1
272#endif
273
274/*
275 * Define if the strlcpy() function exists on the system.
276 */
277/* #define HAVE_STRLCPY 1 */
278
279/*
280 * Define if the open_memstream() function exists on the system.
281 */
282/* #define HAVE_OPEN_MEMSTREAM 1 */
283
284/*
285 * Define if the BSD funopen() function exists on the system.
286 */
287/* #define HAVE_FUNOPEN 1 */
288
289/*
290 * Define if <winsock2.h> exists.
291 * Only MinGW has it.
292 */
293#ifdef USE_MINGW
294#define HAVE_WINSOCK2_H 1
295#else
296/* #define HAVE_WINSOCK2_H */
297#endif
298
299/*
300 * Various definitions missing in MinGW
301 */
302#ifdef USE_MINGW
303#define S_IRGRP 0
304#endif
305
306/*
307 * Define if writev() exists.
308 */
309/* #define HAVE_WRITEV */
310
311/*
312 * Define if <stdint.h> exists.
313 */
314/* #define HAVE_STDINT_H */
315
316/*
317 * Define if <stdbool.h> exists.
318 */
319#define HAVE_STDBOOL_H
320
321/*
322 * Define if <sched.h> exists.
323 */
324/* #define HAVE_SCHED_H */
325
326/*
327 * Define if pread() exists
328 */
329/* #define HAVE_PREAD 1 */
330
331/*
332 * Define if we have st_mtim in struct stat
333 */
334/* #define HAVE_STAT_ST_MTIM 1 */
335
336/*
337 * Define if printf() supports %zd for size_t arguments
338 */
339/* #define HAVE_PRINTF_ZD 1 */
340
341#endif /*_ANDROID_CONFIG_H*/
342