From 848932f93aa8316a38782f1f477c5520672d0b7b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 19 Jun 2014 00:05:43 +0200 Subject: [PATCH] SSE2: Fix for MinGW --HG-- branch : sse2 --- code/nel/include/nel/misc/fixed_size_allocator.h | 4 ++-- code/nel/include/nel/misc/matrix.h | 4 ++-- code/nel/include/nel/misc/types_nl.h | 7 +++++-- code/nel/src/misc/matrix.cpp | 9 +++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/code/nel/include/nel/misc/fixed_size_allocator.h b/code/nel/include/nel/misc/fixed_size_allocator.h index 80b9ed491..079c54bc0 100644 --- a/code/nel/include/nel/misc/fixed_size_allocator.h +++ b/code/nel/include/nel/misc/fixed_size_allocator.h @@ -53,8 +53,8 @@ public: uint getNumAllocatedBlocks() const { return _NumAlloc; } private: class CChunk; - NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) - class CNode + + class NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) CNode { public: CChunk *Chunk; // the Chunk this node belongs to. diff --git a/code/nel/include/nel/misc/matrix.h b/code/nel/include/nel/misc/matrix.h index 37a19b655..649d53324 100644 --- a/code/nel/include/nel/misc/matrix.h +++ b/code/nel/include/nel/misc/matrix.h @@ -53,8 +53,8 @@ class CPlane; * \author Nevrax France * \date 2000 */ -NL_ALIGN_SSE2 -class CMatrix + +class NL_ALIGN_SSE2 CMatrix { public: /// Rotation Order. diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 8eaa77930..6f41deff1 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -342,7 +342,7 @@ typedef unsigned int uint; // at least 32bits (depend of processor) // #ifdef NL_ENABLE_FORCE_INLINE # ifdef NL_COMP_VC # define NL_FORCE_INLINE __forceinline -# elif NL_COMP_GCC +# elif defined(NL_COMP_GCC) # define NL_FORCE_INLINE inline __attribute__((always_inline)) # else # define NL_FORCE_INLINE inline @@ -358,7 +358,10 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #define NL_ALIGN(nb) __attribute__((aligned(nb))) #endif -#ifdef NL_COMP_VC +#ifdef NL_OS_WINDOWS +#include +#include +#include inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); } inline void aligned_free(void *ptr) { _aligned_free(ptr); } #else diff --git a/code/nel/src/misc/matrix.cpp b/code/nel/src/misc/matrix.cpp index dd884f4d5..acfe7ee96 100644 --- a/code/nel/src/misc/matrix.cpp +++ b/code/nel/src/misc/matrix.cpp @@ -140,6 +140,11 @@ inline void CMatrix::testExpandRot() const self->Scale33= 1; } } +void CMatrix::testExpandRotEx() const +{ + testExpandRot(); +} + inline void CMatrix::testExpandProj() const { if(hasProj()) @@ -151,6 +156,10 @@ inline void CMatrix::testExpandProj() const self->a41=0; self->a42=0; self->a43=0; self->a44=1; } } +void CMatrix::testExpandProjEx() const +{ + testExpandProj(); +} // ======================================================================================================