From 393333456cbf3e3a2d6d157658fd1638cff90dea Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Mon, 30 Aug 2010 20:39:04 +0000 Subject: [PATCH] PCSX2 VU: Linux compilation fix and force 16 bytes alignement for VURegs Spu2x: Use a standard destructor (POD safe stuff). Fix various segmentation faults (Issue 846) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3702 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/VU.h | 7 ++++--- plugins/spu2-x/src/defs.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pcsx2/VU.h b/pcsx2/VU.h index d0b4243863..4a061cf66a 100644 --- a/pcsx2/VU.h +++ b/pcsx2/VU.h @@ -116,7 +116,7 @@ struct ialuPipe { u32 Cycle; }; -struct VURegs { +struct __aligned16 VURegs { VECTOR VF[32]; // VF and VI need to be first in this struct for proper mapping REG_VI VI[32]; // needs to be 128bit x 32 (cottonvibes) @@ -190,8 +190,9 @@ extern __aligned16 VURegs vuRegs[2]; static VURegs& VU0 = vuRegs[0]; static VURegs& VU1 = vuRegs[1]; -__fi bool VURegs::IsVU1() const { return this == &vuRegs[1]; } -__fi bool VURegs::IsVU0() const { return this == &vuRegs[0]; } +// Do not use __fi here because it fires 'multiple definition' error in GCC +inline bool VURegs::IsVU1() const { return this == &vuRegs[1]; } +inline bool VURegs::IsVU0() const { return this == &vuRegs[0]; } extern u32* GET_VU_MEM(VURegs* VU, u32 addr); diff --git a/plugins/spu2-x/src/defs.h b/plugins/spu2-x/src/defs.h index 2cc3f2b592..3a7aaf13b6 100644 --- a/plugins/spu2-x/src/defs.h +++ b/plugins/spu2-x/src/defs.h @@ -446,7 +446,7 @@ struct V_Core // uninitialized constructor V_Core() : Index( -1 ), DMAPtr( NULL ) {} V_Core( int idx ); // our badass constructor - virtual ~V_Core() throw(); + ~V_Core() throw(); void Reset( int index ); void Init( int index );