games-action/blackvoxel: add upstream patch: strict aliasing

Signed-off-by: Samuel Bauer <samuel.bauer@yahoo.fr>
This commit is contained in:
Samuel Bauer
2022-07-27 01:17:34 +02:00
parent 2b32f6ee02
commit c3c660461a
2 changed files with 27 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
EAPI=8
inherit desktop flag-o-matic toolchain-funcs xdg
inherit desktop toolchain-funcs xdg
DESCRIPTION="Blackvoxel Video Game"
HOMEPAGE="https://www.blackvoxel.com/"
@@ -29,14 +29,9 @@ S="${WORKDIR}/${PN}_source_${PV//./_}"
PATCHES=(
"${FILESDIR}"/${P}-makefile.patch
"${FILESDIR}"/${P}-savedir.patch
"${FILESDIR}"/${P}-strict-aliasing.patch
)
src_prepare() {
default
append-cflags -fno-strict-aliasing
append-cxxflags -fno-strict-aliasing
}
src_compile() {
export CXX="$(tc-getCXX)"
export CC="$(tc-getCC)"

View File

@@ -0,0 +1,25 @@
diff --git a/src/ZVoxelType_Concrete.cpp b/src/ZVoxelType_Concrete.cpp
index 19a95ad..768e094 100644
--- a/src/ZVoxelType_Concrete.cpp
+++ b/src/ZVoxelType_Concrete.cpp
@@ -37,10 +37,17 @@
ZVoxelExtension * ZVoxelType_Concrete::CreateVoxelExtension(bool IsLoadingPhase)
{
- float Pressure = 0.0;
- ZMemSize Ms = *((ULong *)&Pressure);
+ union
+ {
+ float Pressure;
+ ZVoxelExtension * Extension;
+ };
+
+ Extension = 0;
+ Pressure = 0.0;
+
+ return( Extension );
- return( (ZVoxelExtension *)Ms);
}
void ZVoxelType_Concrete::GetBlockInformations(ZVoxelLocation * DestLocation, ZString & Infos)