$OpenBSD: patch-Source_WTF_wtf_PlatformRegisters_h,v 1.1 2017/09/15 07:43:42 ajacoutot Exp $

XXX no mcontext_t on OpenBSD

Index: Source/WTF/wtf/PlatformRegisters.h
--- Source/WTF/wtf/PlatformRegisters.h.orig
+++ Source/WTF/wtf/PlatformRegisters.h
@@ -33,6 +33,8 @@
 #include <signal.h>
 #elif OS(WINDOWS)
 #include <windows.h>
+#elif OS(OPENBSD)
+typedef ucontext_t mcontext_t;
 #else
 #include <ucontext.h>
 #endif
@@ -74,7 +76,9 @@ struct PlatformRegisters {
 
 inline PlatformRegisters& registersFromUContext(ucontext_t* ucontext)
 {
-#if CPU(PPC)
+#if OS(OPENBSD)
+    return *bitwise_cast<PlatformRegisters*>(ucontext);
+#elif CPU(PPC)
     return *bitwise_cast<PlatformRegisters*>(ucontext->uc_mcontext.uc_regs);
 #else
     return *bitwise_cast<PlatformRegisters*>(&ucontext->uc_mcontext);
