From df30c9d13185a525d2c45de3becd39c4a178f484 Mon Sep 17 00:00:00 2001 From: tma Date: Thu, 22 Sep 2005 03:21:33 +0000 Subject: * Port to MinGW git-svn-id: svn://svn.icculus.org/quake3/trunk@97 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/win32/win_shared.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'code/win32/win_shared.c') diff --git a/code/win32/win_shared.c b/code/win32/win_shared.c index 012a291..0179edc 100644 --- a/code/win32/win_shared.c +++ b/code/win32/win_shared.c @@ -59,14 +59,19 @@ Sys_SnapVector ================ */ long fastftol( float f ) { +#ifndef __MINGW32__ static int tmp; __asm fld f __asm fistp tmp __asm mov eax, tmp +#else + return (long)f; +#endif } void Sys_SnapVector( float *v ) { +#ifndef __MINGW32__ int i; float f; @@ -91,6 +96,11 @@ void Sys_SnapVector( float *v ) v++; *v = fastftol(*v); */ +#else + v[0] = rint(v[0]); + v[1] = rint(v[1]); + v[2] = rint(v[2]); +#endif } @@ -99,8 +109,13 @@ void Sys_SnapVector( float *v ) ** Disable all optimizations temporarily so this code works correctly! ** */ +#ifdef _MSC_VER #pragma optimize( "", off ) +#endif +// If you fancy porting this stuff to AT&T then feel free... :) +// It's not actually used functionally though, so it may be a waste of effort +#ifndef __MINGW32__ /* ** -------------------------------------------------------------------------------- ** @@ -268,13 +283,16 @@ int Sys_GetProcessorId( void ) #endif } +#endif /* ** ** Re-enable optimizations back to what they were ** */ +#ifdef _MSC_VER #pragma optimize( "", on ) +#endif //============================================ -- cgit v1.2.3