Index: src/client/mac/handler/ucontext_compat.h |
diff --git a/src/common/android/include/ucontext.h b/src/client/mac/handler/ucontext_compat.h |
similarity index 71% |
copy from src/common/android/include/ucontext.h |
copy to src/client/mac/handler/ucontext_compat.h |
index 29db8adee69a9eea9ed73e009c5df914e7756ffb..093f9a245a774a2c5e40580a4879e89e7317720b 100644 |
--- a/src/common/android/include/ucontext.h |
+++ b/src/client/mac/handler/ucontext_compat.h |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012, Google Inc. |
+// Copyright 2013 Google Inc. |
// All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without |
@@ -27,30 +27,21 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H |
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H |
- |
-#include <sys/cdefs.h> |
- |
-#ifdef __BIONIC_UCONTEXT_H |
-#include <ucontext.h> |
-#else |
+#ifndef CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ |
+#define CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ |
#include <sys/ucontext.h> |
-#ifdef __cplusplus |
-extern "C" { |
-#endif // __cplusplus |
- |
-// Provided by src/android/common/breakpad_getcontext.S |
-int breakpad_getcontext(ucontext_t* ucp); |
- |
-#define getcontext(x) breakpad_getcontext(x) |
- |
-#ifdef __cplusplus |
-} // extern "C" |
-#endif // __cplusplus |
- |
-#endif // __BIONIC_UCONTEXT_H |
+// The purpose of this file is to work around the fact that ucontext_t's |
+// uc_mcontext member is an mcontext_t rather than an mcontext64_t on ARM64. |
+#if defined(__arm64__) |
+// <sys/ucontext.h> doesn't include the below file. |
+#include <sys/_types/_ucontext64.h> |
+typedef ucontext64_t breakpad_ucontext_t; |
+#define breakpad_uc_mcontext uc_mcontext64 |
+#else |
+typedef ucontext_t breakpad_ucontext_t; |
+#define breakpad_uc_mcontext uc_mcontext |
+#endif // defined(__arm64__) |
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H |
+#endif // CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ |