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
This commit is contained in:
spiral 2011-12-21 23:08:10 +00:00 committed by dhewg
parent ca04dd36d8
commit 7e5795dd56
5 changed files with 24 additions and 4 deletions

View file

@ -621,6 +621,13 @@ void VPCALL idSIMD_SSE::Dot( float *dst, const idVec3 &constant, const idPlane *
#include <xmmintrin.h>
#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 ))

View file

@ -243,6 +243,9 @@ void VPCALL idSIMD_SSE2::CmpLT( byte *dst, const byte bitNum, const float *src0,
#include <xmmintrin.h>
#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 ))

View file

@ -51,6 +51,10 @@ const char * idSIMD_SSE3::GetName( void ) const {
#include <xmmintrin.h>
#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 ))

View file

@ -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 <inttypes.h>
#if !defined(_MSC_VER)
// MSVC does not provide this C99 header
#include <inttypes.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

View file

@ -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 <atlbase.h> (MinGW, VS Express etc.), so assume the min. req. 64Mb
return 64;
#else
unsigned int retSize = 64;