summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <fred@hornsey.us>2018-10-18 15:22:43 -0500
committerFred Hornsey <fred@hornsey.us>2018-10-18 15:22:43 -0500
commit6d77d231876be9f18e8e54dc4fd43d5a9c7177e5 (patch)
tree46399c0da88f25c0300ea62f2717810cb891c456
parentcc9d5d4d536cc031253b986b5fbd4abd07f3652e (diff)
downloadATCD-6d77d231876be9f18e8e54dc4fd43d5a9c7177e5.tar.gz
Try to fix semaphores in older Android NDKs
-rw-r--r--ACE/ace/config-android.h5
-rw-r--r--ACE/ace/os_include/sys/os_sem.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/ACE/ace/config-android.h b/ACE/ace/config-android.h
index f0d6cffc8e1..62e3400b8aa 100644
--- a/ACE/ace/config-android.h
+++ b/ACE/ace/config-android.h
@@ -89,8 +89,11 @@
#endif
// semun was added to sys/sem.h in r15
-#if ACE_ANDROID_NDK_AT_LEAST(15, 0) || __ANDROID_API__ >= 21
+#if __ANDROID_API__ >= 21
# define ACE_HAS_SEMUN
+# if ACE_ANDROID_NDK_LESS_THAN(15, 0)
+# define ACE_HAS_LINUX_SEM_H
+# endif
#endif
// fd_mask was added in r17c
diff --git a/ACE/ace/os_include/sys/os_sem.h b/ACE/ace/os_include/sys/os_sem.h
index 7efec988f7a..91b9b4f1c70 100644
--- a/ACE/ace/os_include/sys/os_sem.h
+++ b/ACE/ace/os_include/sys/os_sem.h
@@ -27,6 +27,10 @@
#if !defined (ACE_LACKS_SYS_SEM_H)
# include /**/ <sys/sem.h>
+#else
+# ifdef ACE_HAS_LINUX_SEM_H
+# include <linux/sem.h>
+# endif
#endif /* !ACE_LACKS_SYS_SEM_H */
// Place all additions (especially function declarations) within extern "C" {}