From 7e5795dd56e7c48c50271a2f8b9476dec2e09373 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 --- neo/idlib/math/Simd_SSE.cpp | 7 +++++++ neo/idlib/math/Simd_SSE2.cpp | 3 +++ neo/idlib/math/Simd_SSE3.cpp | 4 ++++ neo/sys/platform.h | 9 ++++++--- neo/sys/win32/win_shared.cpp | 5 ++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/neo/idlib/math/Simd_SSE.cpp b/neo/idlib/math/Simd_SSE.cpp index e3dbc32b..dba3ac47 100644 --- a/neo/idlib/math/Simd_SSE.cpp +++ b/neo/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/neo/idlib/math/Simd_SSE2.cpp b/neo/idlib/math/Simd_SSE2.cpp index 2c4e5b76..986f8d80 100644 --- a/neo/idlib/math/Simd_SSE2.cpp +++ b/neo/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/neo/idlib/math/Simd_SSE3.cpp b/neo/idlib/math/Simd_SSE3.cpp index cbcbf42c..4ecd7994 100644 --- a/neo/idlib/math/Simd_SSE3.cpp +++ b/neo/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/neo/sys/platform.h b/neo/sys/platform.h index d52c2026..3ec88513 100644 --- a/neo/sys/platform.h +++ b/neo/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 diff --git a/neo/sys/win32/win_shared.cpp b/neo/sys/win32/win_shared.cpp index 5ec90829..826344a2 100644 --- a/neo/sys/win32/win_shared.cpp +++ b/neo/sys/win32/win_shared.cpp @@ -91,8 +91,11 @@ returns in megabytes ================ */ int Sys_GetVideoRam( void ) { -#if defined(ID_DEDICATED) || defined(__MINGW32__) +#if defined(ID_DEDICATED) return 0; +#elif !defined(_MFC_VER) + // no (MinGW, VS Express etc.), so assume the min. req. 64Mb + return 64; #else unsigned int retSize = 64;