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
10 // There is a large number of combinations of these two that can lead to
13 #include <android/ndk-version.h>
14 #include <android/api-level.h>
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__
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)) \
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
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
66 # define ACE_HAS_SEMUN
69 #if __ANDROID_API__ < 23
70 # define ACE_LACKS_TELLDIR
71 # define ACE_LACKS_SEEKDIR
74 #if __ANDROID_API__ < 24
75 # define ACE_LACKS_IF_NAMEINDEX
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
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
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
137 # undef ACE_HAS_AIO_CALLS
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"
155 #if !defined TEST_DIR
156 # define TEST_DIR "/data"
159 #if !defined (ACE_AS_STATIC_LIBS)
160 # if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
161 # error Shared library support is not possible with GCC 4.4.x
165 // The defines listed below might give compile issues when
166 // users declare one letter (IDL) methods. To prevent this,
167 // these defines are undefined here.
168 // The defines are declared in ctype.h and are used in
169 // ctype_base.h as well. That's why <ostream> is included
199 // Disable newer features, result in runtime failures on Android
200 #define ACE_LACKS_GETADDRINFO
201 #define ACE_LACKS_GETNAMEINFO
203 #include /**/ "ace/post.h"
205 #endif /* ACE_CONFIG_ANDROID_H */