AndroidConfig.h revision dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0
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 -- "Darwin".  Used for PPC Mac OS X.
19 *
20 * TODO: split this into "x86" and "ppc" versions
21 */
22#ifndef _ANDROID_CONFIG_H
23#define _ANDROID_CONFIG_H
24
25/*
26 * ===========================================================================
27 *                              !!! IMPORTANT !!!
28 * ===========================================================================
29 *
30 * This file is included by ALL C/C++ source files.  Don't put anything in
31 * here unless you are absolutely certain it can't go anywhere else.
32 *
33 * Any C++ stuff must be wrapped with "#ifdef __cplusplus".  Do not use "//"
34 * comments.
35 */
36
37/*
38 * Threading model.  Choose one:
39 *
40 * HAVE_PTHREADS - use the pthreads library.
41 * HAVE_WIN32_THREADS - use Win32 thread primitives.
42 *  -- combine HAVE_CREATETHREAD, HAVE_CREATEMUTEX, and HAVE__BEGINTHREADEX
43 */
44#define HAVE_PTHREADS
45
46/*
47 * Do we have the futex syscall?
48 */
49
50/* #define HAVE_FUTEX */
51
52/*
53 * Process creation model.  Choose one:
54 *
55 * HAVE_FORKEXEC - use fork() and exec()
56 * HAVE_WIN32_PROC - use CreateProcess()
57 */
58#define HAVE_FORKEXEC
59
60/*
61 * Process out-of-memory adjustment.  Set if running on Linux,
62 * where we can write to /proc/<pid>/oom_adj to modify the out-of-memory
63 * badness adjustment.
64 */
65/* #define HAVE_OOM_ADJ */
66
67/*
68 * IPC model.  Choose one:
69 *
70 * HAVE_SYSV_IPC - use the classic SysV IPC mechanisms (semget, shmget).
71 * HAVE_MACOSX_IPC - use Macintosh IPC mechanisms (sem_open, mmap).
72 * HAVE_WIN32_IPC - use Win32 IPC (CreateSemaphore, CreateFileMapping).
73 * HAVE_ANDROID_IPC - use Android versions (?, mmap).
74 */
75#define HAVE_MACOSX_IPC
76
77/*
78 * Memory-mapping model. Choose one:
79 *
80 * HAVE_POSIX_FILEMAP - use the Posix sys/mmap.h
81 * HAVE_WIN32_FILEMAP - use Win32 filemaps
82 */
83#define  HAVE_POSIX_FILEMAP
84
85/*
86 * Define this if you have <termio.h>
87 */
88#define  HAVE_TERMIO_H
89
90/*
91 * Define this if you build against MSVCRT.DLL
92 */
93/* #define HAVE_MS_C_RUNTIME */
94
95/*
96 * Define this if you have sys/uio.h
97 */
98#define  HAVE_SYS_UIO_H
99
100/*
101 * Define this if your platforms implements symbolic links
102 * in its filesystems
103 */
104#define HAVE_SYMLINKS
105
106/*
107 * Define this if we have localtime_r().
108 */
109#define HAVE_LOCALTIME_R
110
111/*
112 * Define this if we have gethostbyname_r().
113 */
114/* #define HAVE_GETHOSTBYNAME_R */
115
116/*
117 * Define this if we have ioctl().
118 */
119/* #define HAVE_IOCTL */
120
121/*
122 * Define this if we want to use WinSock.
123 */
124/* #define HAVE_WINSOCK */
125
126/*
127 * Define this if have clock_gettime() and friends
128 */
129/* #define HAVE_POSIX_CLOCKS */
130
131/*
132 * Define this if we have pthread_cond_timedwait_monotonic() and
133 * clock_gettime(CLOCK_MONOTONIC).
134 */
135/* #define HAVE_TIMEDWAIT_MONOTONIC */
136
137/*
138 * Endianness of the target machine.  Choose one:
139 *
140 * HAVE_ENDIAN_H -- have endian.h header we can include.
141 * HAVE_LITTLE_ENDIAN -- we are little endian.
142 * HAVE_BIG_ENDIAN -- we are big endian.
143 */
144#if (defined(__ppc__) || defined(__ppc64__))
145#   define HAVE_BIG_ENDIAN
146#elif defined(__i386__)
147#   define HAVE_LITTLE_ENDIAN
148#endif
149
150/*
151 * We need to choose between 32-bit and 64-bit off_t.  All of our code should
152 * agree on the same size.  For desktop systems, use 64-bit values,
153 * because some of our libraries (e.g. wxWidgets) expect to be built that way.
154 */
155#define _FILE_OFFSET_BITS 64
156#define _LARGEFILE_SOURCE 1
157
158/*
159 * Defined if we have the backtrace() call for retrieving a stack trace.
160 * Needed for CallStack to operate; if not defined, CallStack is
161 * non-functional.
162 */
163#define HAVE_BACKTRACE 0
164
165/*
166 * Defined if we have the dladdr() call for retrieving the symbol associated
167 * with a memory address.  If not defined, stack crawls will not have symbolic
168 * information.
169 */
170#define HAVE_DLADDR 0
171
172/*
173 * Defined if we have the cxxabi.h header for demangling C++ symbols.  If
174 * not defined, stack crawls will be displayed with raw mangled symbols
175 */
176#define HAVE_CXXABI 0
177
178/*
179 * Defined if we have the gettid() system call.
180 */
181/* #define HAVE_GETTID */
182
183
184/*
185 * Add any extra platform-specific defines here.
186 */
187#define _THREAD_SAFE
188
189/*
190 * Define if we have <malloc.h> header
191 */
192/* #define HAVE_MALLOC_H */
193
194/*
195 * Define if tm struct has tm_gmtoff field
196 */
197#define HAVE_TM_GMTOFF 1
198
199/*
200 * Define if dirent struct has d_type field
201 */
202#define HAVE_DIRENT_D_TYPE 1
203
204/*
205 * Define if we have madvise() in <sys/mman.h>
206 */
207#define HAVE_MADVISE 1
208
209/*
210 * Define if we include <sys/mount.h> for statfs()
211 */
212#define INCLUDE_SYS_MOUNT_FOR_STATFS 1
213
214/*
215 * What CPU architecture does this platform use?
216 */
217#if (defined(__ppc__) || defined(__ppc64__))
218#   define ARCH_PPC
219#elif defined(__i386__)
220#   define ARCH_X86
221#endif
222
223/*
224 * sprintf() format string for shared library naming.
225 */
226#define OS_SHARED_LIB_FORMAT_STR    "lib%s.dylib"
227
228/*
229 * type for the third argument to mincore().
230 */
231#define MINCORE_POINTER_TYPE char *
232
233/*
234 * The default path separator for the platform
235 */
236#define OS_PATH_SEPARATOR '/'
237
238/*
239 * Is the filesystem case sensitive?
240 *
241 * For tools apps, we'll treat is as not case sensitive.
242 */
243/* #define OS_CASE_SENSITIVE */
244
245/*
246 * Define if <sys/socket.h> exists.
247 */
248#define HAVE_SYS_SOCKET_H 1
249
250/*
251 * Define if the strlcpy() function exists on the system.
252 */
253#define HAVE_STRLCPY 1
254
255/*
256 * Define if writev() exists
257 */
258#define HAVE_WRITEV 1
259
260#endif /*_ANDROID_CONFIG_H*/
261