Index: runtime/vm/signal_handler.h |
=================================================================== |
--- runtime/vm/signal_handler.h (revision 39843) |
+++ runtime/vm/signal_handler.h (working copy) |
@@ -12,6 +12,9 @@ |
#include <signal.h> // NOLINT |
#include <ucontext.h> // NOLINT |
#elif defined(TARGET_OS_ANDROID) |
+#include <android/api-level.h> // NOLINT |
+/* Android <= 19 doesn't have ucontext.h */ |
+#if __ANDROID_API__ <= 19 |
#include <signal.h> // NOLINT |
#include <asm/sigcontext.h> // NOLINT |
// These are not defined on Android, so we have to define them here. |
@@ -23,6 +26,11 @@ |
struct sigcontext uc_mcontext; |
uint32_t uc_sigmask; |
} ucontext_t; |
+#else |
+// Android > 19 has ucontext.h |
+#include <signal.h> // NOLINT |
+#include <ucontext.h> // NOLINT |
+#endif // __ANDROID_API__ <= 19 |
#elif defined(TARGET_OS_MACOS) |
#include <signal.h> // NOLINT |
#include <sys/ucontext.h> // NOLINT |