aboutsummaryrefslogtreecommitdiff
path: root/libc/include/android/legacy_signal_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/include/android/legacy_signal_inlines.h')
-rw-r--r--libc/include/android/legacy_signal_inlines.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h
index 90eda7dc1..95c2320db 100644
--- a/libc/include/android/legacy_signal_inlines.h
+++ b/libc/include/android/legacy_signal_inlines.h
@@ -45,12 +45,34 @@ int __libc_current_sigrtmax() __attribute__((__weak__)) __VERSIONER_NO_GUARD;
int __libc_current_sigrtmin() __attribute__((__weak__)) __VERSIONER_NO_GUARD;
static __inline int __ndk_legacy___libc_current_sigrtmax() {
- if (__libc_current_sigrtmax) return __libc_current_sigrtmax();
+ /*
+ * The NDK doesn't use libclang_rt.builtins yet (https://github.com/android/ndk/issues/1231) so it
+ * can't use __builtin_available, but the platform builds with -Werror=unguarded-availability so
+ * it requires __builtin_available.
+ */
+#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
+ if (__builtin_available(android 21, *)) {
+#else
+ if (__libc_current_sigrtmax) {
+#endif
+ return __libc_current_sigrtmax();
+ }
return __SIGRTMAX; /* Should match __libc_current_sigrtmax. */
}
static __inline int __ndk_legacy___libc_current_sigrtmin() {
- if (__libc_current_sigrtmin) return __libc_current_sigrtmin();
+ /*
+ * The NDK doesn't use libclang_rt.builtins yet (https://github.com/android/ndk/issues/1231) so it
+ * can't use __builtin_available, but the platform builds with -Werror=unguarded-availability so
+ * it requires __builtin_available.
+ */
+#if defined(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)
+ if (__builtin_available(android 21, *)) {
+#else
+ if (__libc_current_sigrtmin) {
+#endif
+ return __libc_current_sigrtmin();
+ }
return __SIGRTMIN + 7; /* Should match __libc_current_sigrtmin. */
}