From 6ba4df1b638c2f673213628c3da6389bd20a26e8 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 1 Oct 2021 14:52:01 +1000
Subject: Fix for Haiku


diff --git a/qtdeclarative/src/3rdparty/masm/wtf/PageBlock.cpp b/qtdeclarative/src/3rdparty/masm/wtf/PageBlock.cpp
index bc0e8d6..8b62344 100644
--- a/qtdeclarative/src/3rdparty/masm/wtf/PageBlock.cpp
+++ b/qtdeclarative/src/3rdparty/masm/wtf/PageBlock.cpp
@@ -40,7 +40,14 @@ namespace WTF {
 static size_t s_pageSize;
 static size_t s_pageMask;
 
-#if OS(UNIX)
+#if OS(HAIKU)
+
+inline size_t systemPageSize()
+{
+    return 4096;
+}
+
+#elif OS(UNIX)
 
 inline size_t systemPageSize()
 {
diff --git a/qtdeclarative/src/3rdparty/masm/wtf/Platform.h b/qtdeclarative/src/3rdparty/masm/wtf/Platform.h
index 29decfa..1dbd001 100644
--- a/qtdeclarative/src/3rdparty/masm/wtf/Platform.h
+++ b/qtdeclarative/src/3rdparty/masm/wtf/Platform.h
@@ -418,6 +418,11 @@
 #define WTF_OS_QNX 1
 #endif
 
+/* OS(HAIKU) - Haiku */
+#if defined(__HAIKU__)
+#define WTF_OS_HAIKU 1
+#endif
+
 /* OS(SOLARIS) - Solaris */
 #if defined(sun) || defined(__sun)
 #define WTF_OS_SOLARIS 1
@@ -452,6 +457,7 @@
     || OS(HURD)             \
     || OS(INTEGRITY)        \
     || OS(LINUX)            \
+    || OS(HAIKU)            \
     || OS(NETBSD)           \
     || OS(OPENBSD)          \
     || OS(QNX)              \
diff --git a/qtdeclarative/src/qml/jit/qv4assemblercommon_p.h b/qtdeclarative/src/qml/jit/qv4assemblercommon_p.h
index c91a61a..61c9ffd 100644
--- a/qtdeclarative/src/qml/jit/qv4assemblercommon_p.h
+++ b/qtdeclarative/src/qml/jit/qv4assemblercommon_p.h
@@ -66,7 +66,7 @@ namespace QV4 {
 namespace JIT {
 
 #if defined(Q_PROCESSOR_X86_64) || defined(ENABLE_ALL_ASSEMBLERS_FOR_REFACTORING_PURPOSES)
-#if defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD) || defined(Q_OS_DARWIN)
+#if defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD) || defined(Q_OS_DARWIN) || defined(Q_OS_HAIKU)
 
 class PlatformAssembler_X86_64_SysV : public JSC::MacroAssembler<JSC::MacroAssemblerX86_64>
 {
-- 
2.30.2

