gzdoom/more-32bit.patch

56 lines
2.0 KiB
Diff

From: Jan Engelhardt <jengelh@inai.de>
Date: 2023-11-03 10:46:06.423636287 +0100
VkSurfaceKHR is an alias to `struct something *` on 64-bit platforms, but to
`uint64_t` on 32-bit. Using {} will clear it without running into a type error:
[ 88s] sdlglvideo.cpp:294:54: error: cannot convert 'std::nullptr_t' to
'VkSurfaceKHR' {aka 'long long unsigned int'} in initialization
[ 88s] 294 | VkSurfaceKHR surfacehandle = nullptr;
static_assert for particle_t also failed, because it's 120 on ILP32.
---
src/common/platform/posix/sdl/sdlglvideo.cpp | 2 +-
src/playsim/p_effect.h | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
Index: gzdoom-g4.12.2/src/common/platform/posix/sdl/sdlglvideo.cpp
===================================================================
--- gzdoom-g4.12.2.orig/src/common/platform/posix/sdl/sdlglvideo.cpp
+++ gzdoom-g4.12.2/src/common/platform/posix/sdl/sdlglvideo.cpp
@@ -400,7 +400,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffe
builder.RequireExtension(names[i]);
auto instance = builder.Create();
- VkSurfaceKHR surfacehandle = nullptr;
+ VkSurfaceKHR surfacehandle = {};
if (!I_CreateVulkanSurface(instance->Instance, &surfacehandle))
VulkanError("I_CreateVulkanSurface failed");
Index: gzdoom-g4.12.2/src/playsim/p_effect.h
===================================================================
--- gzdoom-g4.12.2.orig/src/playsim/p_effect.h
+++ gzdoom-g4.12.2/src/playsim/p_effect.h
@@ -70,7 +70,10 @@ enum EParticleFlags
class DVisualThinker;
struct particle_t
{
- subsector_t* subsector; //+8 = 8
+ union {
+ subsector_t* subsector;
+ uint64_t _pad0; //+8 = 8
+ };
DVector3 Pos; //+24 = 32
FVector3 Vel; //+12 = 44
FVector3 Acc; //+12 = 56
@@ -83,7 +86,7 @@ struct particle_t
float Roll, RollVel, RollAcc; //+12 = 100
uint16_t tnext, snext, tprev; //+6 = 106
uint16_t flags; //+2 = 108
- // uint32_t padding; //+4 = 112
+ uint32_t padding; //+4 = 112
FStandaloneAnimation animData; //+16 = 128
};