1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

More portions of the SDK compile (and link!) on Mac OS X (bug 4392, r=dvander).

SourceMod compiles and links now. Hurray! Most plugins may also but there may be more work to do.
This commit is contained in:
Scott Ehlert
2010-05-13 04:08:37 -05:00
parent 7daeca53eb
commit b06949c4cc
29 changed files with 92 additions and 85 deletions

View File

@ -327,7 +327,7 @@ void inline SinCos( float radians, float *sine, float *cosine )
fstp DWORD PTR [edx]
fstp DWORD PTR [eax]
}
#elif defined( _LINUX )
#elif defined( _LINUX ) || defined ( __APPLE__ )
register double __cosr, __sinr;
__asm __volatile__
("fsincos"
@ -1091,7 +1091,7 @@ FORCEINLINE int RoundFloatToInt(float f)
fld f
fistp nResult
}
#elif _LINUX
#elif defined( _LINUX ) || defined( __APPLE__ )
__asm __volatile__ (
"fistpl %0;": "=m" (nResult): "t" (f) : "st"
);
@ -1128,7 +1128,7 @@ FORCEINLINE unsigned char RoundFloatToByte(float f)
fld f
fistp nResult
}
#elif _LINUX
#elif defined( _LINUX ) || defined( __APPLE__ )
__asm __volatile__ (
"fistpl %0;": "=m" (nResult): "t" (f) : "st"
);
@ -1167,7 +1167,7 @@ FORCEINLINE unsigned long RoundFloatToUnsignedLong(float f)
fld f
fistp qword ptr nResult
}
#elif _LINUX
#elif defined( _LINUX ) || defined( __APPLE__ )
__asm __volatile__ (
"fistpl %0;": "=m" (nResult): "t" (f) : "st"
);
@ -1212,7 +1212,7 @@ FORCEINLINE int Float2Int( float a )
fistp RetVal // Store and converted (to int) result
fldcw CtrlwdHolder // Restore control word
}
#elif _LINUX
#elif defined( _LINUX ) || defined ( __APPLE__ )
RetVal = static_cast<int>( a );
#endif
@ -1242,7 +1242,7 @@ inline int Floor2Int( float a )
fistp RetVal // Store floored and converted (to int) result
fldcw CtrlwdHolder // Restore control word
}
#elif _LINUX
#elif defined( _LINUX ) || defined( __APPLE__ )
RetVal = static_cast<int>( floor(a) );
#endif
@ -1300,7 +1300,7 @@ inline int Ceil2Int( float a )
fistp RetVal // Store floored and converted (to int) result
fldcw CtrlwdHolder // Restore control word
}
#elif _LINUX
#elif defined( _LINUX ) || defined( __APPLE__ )
RetVal = static_cast<int>( ceil(a) );
#endif