1From c70df6bf52cdcdceb73ed965a28642177df32943 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 13 Mar 2021 12:58:32 -0800
4Subject: [PATCH] Qt3D: Add support to fix build on ppc64
5
6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 src/foundation/Qt3DSPreprocessor.h | 2 +-
10 src/foundation/Qt3DSSystem.cpp     | 8 +++++++-
11 2 files changed, 8 insertions(+), 2 deletions(-)
12
13--- a/src/foundation/Qt3DSPreprocessor.h
14+++ b/src/foundation/Qt3DSPreprocessor.h
15@@ -112,11 +112,11 @@ Platform define
16 #define QT3DS_VMX
17 #elif defined(__x86_64__)
18 #define QT3DS_X64
19-#elif defined(__ppc__)
20-#define QT3DS_PPC
21-#elif defined(__ppc64__)
22+#elif defined(__powerpc64__)
23 #define QT3DS_PPC
24 #define QT3DS_PPC64
25+#elif defined(__ppc__)
26+#define QT3DS_PPC
27 //#   elif defined(__aarch64__)
28 //#       define QT3DS_ARM_64
29 #else
30--- a/src/foundation/Qt3DSSystem.cpp
31+++ b/src/foundation/Qt3DSSystem.cpp
32@@ -62,6 +62,10 @@ const char *qt3ds::foundation::System::g
33 const char *qt3ds::foundation::System::g_Processor = "x64";
34 const char *qt3ds::foundation::System::g_BitWidth = "64";
35 const char *qt3ds::foundation::System::g_FloatingPointModel = "";
36+#elif defined(QT3DS_PPC64)
37+const char *qt3ds::foundation::System::g_Processor = "ppc64";
38+const char *qt3ds::foundation::System::g_BitWidth = "64";
39+const char *qt3ds::foundation::System::g_FloatingPointModel = "";
40 #elif defined(QT3DS_ARM)
41 #if defined(__aarch64__) || defined(__ARM64__)
42 const char *qt3ds::foundation::System::g_Processor = "arm";
43@@ -79,7 +83,7 @@ const char *qt3ds::foundation::System::g
44 #endif
45 #endif
46 #else
47-#error "Unknown Platform"
48+//#error "Unknown Platform"
49 #endif
50
51 #if defined(QT3DS_ARM)
52@@ -97,8 +101,10 @@ const char *qt3ds::foundation::System::g
53 const char *qt3ds::foundation::System::g_GPUType = "";
54 #elif defined(QT3DS_X64)
55 const char *qt3ds::foundation::System::g_GPUType = "";
56+#elif defined(QT3DS_PPC64)
57+const char *qt3ds::foundation::System::g_GPUType = "";
58 #else
59-#error "Must define a processor type (QT3DS_ARM or QT3DS_X86)"
60+//#error "Must define a processor type (QT3DS_ARM or QT3DS_X86)"
61 #endif
62
63 namespace {
64@@ -136,4 +142,4 @@ const char *System::getPlatformGLStr()
65         strcpy(text, str.c_str());
66     }
67     return text;
68-}
69\ No newline at end of file
70+}
71