diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-09-22 03:21:33 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-09-22 03:21:33 +0000 |
commit | df30c9d13185a525d2c45de3becd39c4a178f484 (patch) | |
tree | 3cf10550bfe1d9473252bfc3ad56b8007652e622 /code/win32/win_shared.c | |
parent | 3873056dc5e0a7c314fa42dd70c072027ccccec0 (diff) | |
download | ioquake3-aero-df30c9d13185a525d2c45de3becd39c4a178f484.tar.gz ioquake3-aero-df30c9d13185a525d2c45de3becd39c4a178f484.zip |
* Port to MinGW
git-svn-id: svn://svn.icculus.org/quake3/trunk@97 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/win32/win_shared.c')
-rw-r--r-- | code/win32/win_shared.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 //============================================ |