Revert to Current Include Style
[ACE_TAO.git] / ACE / ace / config-android.h
blobea367836bafaa9cded250bb56f87c1a4ba3beed9
1 // -*- C++ -*-
2 // Config Header file for Android NDK
4 #ifndef ACE_CONFIG_ANDROID_H
5 #define ACE_CONFIG_ANDROID_H
6 #include /**/ "ace/pre.h"
8 // NOTE: We must be careful from now on to distinguish between the API level
9 // and NDK version.
10 // There is a large number of combinations of these two that can lead to
11 // problems.
13 #include <android/ndk-version.h>
14 #include <android/api-level.h>
16 #define ACE_ANDROID
17 #define ACE_PLATFORM_CONFIG config-android.h
19 #include "ace/config-linux-common.h"
22 * Android NDK Revision Macros
24 * Revisions Scheme Work Like This:
25 * Revision | __NDK_MAJOR__ | __NDK_MINOR__ | __NDK__BETA__
26 * r16 | 16 | 0 | 0
27 * r16b | 16 | 1 | 0
28 * r16c | 16 | 2 | 0
29 * r22-beta1| 22 | 0 | 1
31 * __NDK_BETA__ is starts at 1 and increments until release when it is 0.
33 #define ACE_ANDROID_NDK_AT_LEAST(MAJ, MIN, BET) (\
34 (__NDK_MAJOR__ > (MAJ)) || \
35 (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ >= (MIN)) || \
36 (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ == (MIN) && \
37 (__NDK_BETA__ == 0 || __NDK_BETA__ >= (BET)) \
38 ) \
41 #define ACE_ANDROID_NDK_EXACTLY(MAJ, MIN, BET) \
42 (__NDK_MAJOR__ == (MAJ) && __NDK_MINOR__ == (MIN) && __NDK_BETA__ == (BETA))
44 #define ACE_ANDROID_NDK_LESS_THAN(MAJ, MIN, BET) \
45 !ACE_ANDROID_NDK_AT_LEAST((MAJ), (MIN), (BET))
47 #if __ANDROID_API__ < 18
48 # define ACE_LACKS_LOG2
49 #endif
51 #if __ANDROID_API__ < 21
52 # define ACE_LACKS_SEARCH_H
53 # define ACE_LACKS_SYS_SEM_H
54 # define ACE_LACKS_SEMBUF_T
55 # define ACE_LACKS_SYS_MSG_H
56 # define ACE_LACKS_SYS_SHM_H
57 # define ACE_LACKS_SYSV_SHMEM
58 # define ACE_LACKS_RAND_R
59 # define ACE_LACKS_WCSTOLL
60 # define ACE_LACKS_WCSTOULL
61 # define ACE_LACKS_CONDATTR_SETCLOCK
62 # ifdef ACE_HAS_EVENT_POLL
63 # undef ACE_HAS_EVENT_POLL
64 # endif
65 #else
66 # define ACE_HAS_SEMUN
67 #endif
69 #if __ANDROID_API__ < 23
70 # define ACE_LACKS_TELLDIR
71 # define ACE_LACKS_SEEKDIR
72 #endif
74 #if __ANDROID_API__ < 24
75 # define ACE_LACKS_IF_NAMEINDEX
76 #endif
78 // These were available before r18, but in r18 they are restricted to API >= 28 ¯\_(ツ)_/¯
79 #if __ANDROID_API__ < 28
80 # define ACE_LACKS_SETHOSTENT
81 # define ACE_LACKS_ENDHOSTENT
82 #endif
84 #define ACE_HAS_UCONTEXT_T
85 #define ACE_HAS_CLOCK_SETTIME
86 #define ACE_HAS_CPU_SET_T
88 // system errorno is a volatile int
89 #define ACE_HAS_VOLATILE_ERRNO
90 #define ACE_ERRNO_TYPE volatile int
92 // Android doesn't check is sig is out of range.
93 #define ACE_HAS_SIGISMEMBER_BUG
95 #define ACE_HAS_PTHREADS_UNIX98_EXT
97 // Android does not support pthread concurrency (yet)
98 #define ACE_LACKS_MUTEXATTR_PSHARED 1
100 // the android definition of struct stat{} uses
101 // unsigned long rather than time_t for st_[acm]time
102 // members of the stat struct used to report file
103 // status details.
104 #define ACE_USES_ULONG_FOR_STAT_TIME
106 #define ACE_LACKS_NEW_H
107 #define ACE_LACKS_SIGINFO_H
108 #define ACE_LACKS_STROPTS_H
109 #define ACE_LACKS_SYS_SYSCTL_H
111 #define ACE_LACKS_GETLOADAVG
112 #define ACE_LACKS_ISCTYPE
113 #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
114 #define ACE_LACKS_PWD_FUNCTIONS
115 #define ACE_LACKS_STRRECVFD
116 #define ACE_LACKS_PTHREAD_CANCEL // posix_limits.h explicitly says this
117 #define ACE_LACKS_SETINHERITSCHED // posix_limits.h explicitly says this
118 #define ACE_LACKS_SWAB
120 // Android seems to have 64 keys of which Android itself use 5
121 #define ACE_DEFAULT_THREAD_KEYS 59
123 // Android Standalone compiler std library does not include
124 // wide character support
125 // Used in tests/Sequence_Unit_Tests/string_sequence_tester.hpp
126 # define TAO_LACKS_WCHAR_CXX_STDLIB
128 // @todo JW, test if this works
129 // #define ACE_HAS_POSIX_SEM
130 // #define ACE_HAS_POSIX_SEM_TIMEOUT
132 // AIO support pulls in the rt library, which pulls in the pthread
133 // library. Disable AIO in single-threaded builds.
134 #if defined (ACE_HAS_THREADS)
135 # define ACE_HAS_CLOCK_GETTIME
136 #else
137 # undef ACE_HAS_AIO_CALLS
138 #endif
140 #define ACE_HAS_SIGINFO_T
141 #define ACE_HAS_SOCKLEN_T
142 #define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
144 #define ACE_LACKS_CUSERID
146 #define ACE_MMAP_NO_ZERO
148 #define ACE_HAS_NETLINK
149 #define ACE_HAS_SIOCGIFCONF
151 #if !defined ACE_DEFAULT_TEMP_DIR
152 # define ACE_DEFAULT_TEMP_DIR "/data/tmp"
153 #endif
155 #if !defined TEST_DIR
156 # define TEST_DIR "/data"
157 #endif
159 #define ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE
161 #if !defined (ACE_AS_STATIC_LIBS)
162 # if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
163 # error Shared library support is not possible with GCC 4.4.x
164 # endif
165 #endif
167 // The defines listed below might give compile issues when
168 // users declare one letter (IDL) methods. To prevent this,
169 // these defines are undefined here.
170 // The defines are declared in ctype.h and are used in
171 // ctype_base.h as well. That's why <ostream> is included
172 // as well.
173 #include "ctype.h"
174 #include <ostream>
176 #if defined (_U)
177 # undef _U
178 #endif
179 #if defined (_L)
180 # undef _L
181 #endif
182 #if defined (_N)
183 # undef _N
184 #endif
185 #if defined (_S)
186 # undef _S
187 #endif
188 #if defined (_P)
189 # undef _P
190 #endif
191 #if defined (_C)
192 # undef _C
193 #endif
194 #if defined (_X)
195 # undef _X
196 #endif
197 #if defined (_B)
198 # undef _B
199 #endif
201 // Disable newer features, result in runtime failures on Android
202 #define ACE_LACKS_GETADDRINFO
203 #define ACE_LACKS_GETNAMEINFO
205 #include /**/ "ace/post.h"
207 #endif /* ACE_CONFIG_ANDROID_H */