X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FMacCompatibility.h;h=932d0a0fdfa7b85d237048f125a4e898f01bb68b;hb=bcb5c54b2b6170c185583c18f5ec97b0bb813f0a;hp=95781f23160ea6c8c80008b4119b02538cef7682;hpb=40a3dd7b76b6b10ae05dbd074f1f80ea7b4aa96d;p=lugaru.git diff --git a/Source/MacCompatibility.h b/Source/MacCompatibility.h index 95781f2..932d0a0 100644 --- a/Source/MacCompatibility.h +++ b/Source/MacCompatibility.h @@ -5,10 +5,11 @@ #include #include +#include -// stuff to make Mac code compatable with Windows - +// stuff to make Mac code compatable with Windows/Linux/etc +#ifdef _MSC_VER // disable warnings about double to float conversions #pragma warning(disable:4305) #pragma warning(disable:4244) @@ -18,6 +19,13 @@ // disable warning about unreferenced local variables #pragma warning(disable:4101) +#endif + +#ifndef __forceinline +# ifdef __GNUC__ +# define __forceinline inline __attribute__((always_inline)) +# endif +#endif typedef bool Boolean; @@ -63,12 +71,13 @@ enum Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b); - +#ifdef _MSC_VER inline bool isnormal( double x) { int ret = _fpclass( x); return (ret == _FPCLASS_NN || ret == _FPCLASS_PN); } +#endif typedef unsigned int uintptr_t; @@ -92,7 +101,7 @@ return -f; return f; } */ -inline long long abs( long long f) +__forceinline long long longlongabs( long long f) { if (f < 0) return -f; @@ -101,3 +110,4 @@ inline long long abs( long long f) #endif #endif +