From 139726bc37f5dabdef88eb4d096fed8c87b3019d Mon Sep 17 00:00:00 2001 From: spiral Date: Wed, 21 Dec 2011 23:08:10 +0000 Subject: [PATCH] Add missing includes for MSVC - MSVC doesn't provide C99 headers - Default to min. req. 64Mb video mem if no COM present - Move misplaced __attribute__((packed)) from MSVC to MinGW --- idlib/math/Simd_SSE.cpp | 7 +++++++ idlib/math/Simd_SSE2.cpp | 3 +++ idlib/math/Simd_SSE3.cpp | 4 ++++ sys/platform.h | 9 ++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/idlib/math/Simd_SSE.cpp b/idlib/math/Simd_SSE.cpp index e3dbc32..dba3ac4 100644 --- a/idlib/math/Simd_SSE.cpp +++ b/idlib/math/Simd_SSE.cpp @@ -621,6 +621,13 @@ void VPCALL idSIMD_SSE::Dot( float *dst, const idVec3 &constant, const idPlane * #include +#include "idlib/geometry/JointTransform.h" +#include "idlib/math/Vector.h" +#include "idlib/math/Matrix.h" +#include "idlib/math/Quat.h" +#include "idlib/math/Plane.h" +#include "renderer/Model.h" + #define SHUFFLEPS( x, y, z, w ) (( (x) & 3 ) << 6 | ( (y) & 3 ) << 4 | ( (z) & 3 ) << 2 | ( (w) & 3 )) #define R_SHUFFLEPS( x, y, z, w ) (( (w) & 3 ) << 6 | ( (z) & 3 ) << 4 | ( (y) & 3 ) << 2 | ( (x) & 3 )) diff --git a/idlib/math/Simd_SSE2.cpp b/idlib/math/Simd_SSE2.cpp index 2c4e5b7..986f8d8 100644 --- a/idlib/math/Simd_SSE2.cpp +++ b/idlib/math/Simd_SSE2.cpp @@ -243,6 +243,9 @@ void VPCALL idSIMD_SSE2::CmpLT( byte *dst, const byte bitNum, const float *src0, #include +#include "idlib/geometry/JointTransform.h" +#include "idlib/math/Math.h" + #define SHUFFLEPS( x, y, z, w ) (( (x) & 3 ) << 6 | ( (y) & 3 ) << 4 | ( (z) & 3 ) << 2 | ( (w) & 3 )) #define R_SHUFFLEPS( x, y, z, w ) (( (w) & 3 ) << 6 | ( (z) & 3 ) << 4 | ( (y) & 3 ) << 2 | ( (x) & 3 )) #define SHUFFLEPD( x, y ) (( (x) & 1 ) << 1 | ( (y) & 1 )) diff --git a/idlib/math/Simd_SSE3.cpp b/idlib/math/Simd_SSE3.cpp index cbcbf42..4ecd799 100644 --- a/idlib/math/Simd_SSE3.cpp +++ b/idlib/math/Simd_SSE3.cpp @@ -51,6 +51,10 @@ const char * idSIMD_SSE3::GetName( void ) const { #include +#include "idlib/geometry/JointTransform.h" +#include "idlib/geometry/DrawVert.h" +#include "idlib/math/Vector.h" + #define SHUFFLEPS( x, y, z, w ) (( (x) & 3 ) << 6 | ( (y) & 3 ) << 4 | ( (z) & 3 ) << 2 | ( (w) & 3 )) #define R_SHUFFLEPS( x, y, z, w ) (( (w) & 3 ) << 6 | ( (z) & 3 ) << 4 | ( (y) & 3 ) << 2 | ( (x) & 3 )) #define SHUFFLEPD( x, y ) (( (x) & 1 ) << 1 | ( (y) & 1 )) diff --git a/sys/platform.h b/sys/platform.h index d52c202..3ec8851 100644 --- a/sys/platform.h +++ b/sys/platform.h @@ -54,13 +54,13 @@ If you have questions concerning this license or the applicable additional terms #ifdef _MSC_VER #define ALIGN16( x ) __declspec(align(16)) x -#define PACKED __attribute__((packed)) +#define PACKED #define ID_INLINE __forceinline #define ID_STATIC_TEMPLATE static #define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) ) #else #define ALIGN16( x ) x __attribute__ ((aligned (16))) -#define PACKED +#define PACKED __attribute__((packed)) #define ID_INLINE inline #define ID_STATIC_TEMPLATE #define assertmem( x, y ) @@ -168,7 +168,10 @@ If you have questions concerning this license or the applicable additional terms #define id_attribute(x) #endif -#include +#if !defined(_MSC_VER) + // MSVC does not provide this C99 header + #include +#endif #include #include #include