Fix macOS build in ART's runtime/runtime_common.{h,cc}

Test: mmma art (on macOS)
Bug: 32466479
Change-Id: I9996c6a495d2465a4b00affd2ef19102c815a58f
diff --git a/runtime/runtime_common.h b/runtime/runtime_common.h
index 52817fd..832b6bb 100644
--- a/runtime/runtime_common.h
+++ b/runtime/runtime_common.h
@@ -19,6 +19,12 @@
 
 // Code shared by runtime/runtime_android.cc and runtime/runtime_linux.cc.
 
+#if defined(__APPLE__)
+// On macOS, _XOPEN_SOURCE must be defined to access ucontext
+// routines, as they are considered deprecated on that platform.
+#define _XOPEN_SOURCE
+#endif
+
 #include <sys/utsname.h>
 #include <ucontext.h>
 
@@ -56,20 +62,6 @@
 const char* GetSignalName(int signal_number);
 const char* GetSignalCodeName(int signal_number, int signal_code);
 
-struct UContext {
-  explicit UContext(void* raw_context)
-      : context(reinterpret_cast<ucontext_t*>(raw_context)->uc_mcontext) {}
-
-  void Dump(std::ostream& os) const;
-
-  void DumpRegister32(std::ostream& os, const char* name, uint32_t value) const;
-  void DumpRegister64(std::ostream& os, const char* name, uint64_t value) const;
-
-  void DumpX86Flags(std::ostream& os, uint32_t flags) const;
-
-  mcontext_t& context;
-};
-
 // Return the signal number we recognize as timeout. -1 means not active/supported.
 int GetTimeoutSignal();