1 #ifndef _MACCOMPATIBLITY_H_
2 #define _MACCOMPATIBLITY_H_
10 // stuff to make Mac code compatable with Windows/Linux/etc
13 // disable warnings about double to float conversions
14 #pragma warning(disable:4305)
15 #pragma warning(disable:4244)
17 // disable warnings about boolean to int conversions
18 #pragma warning(disable:4800)
20 // disable warning about unreferenced local variables
21 #pragma warning(disable:4101)
26 # define __forceinline inline __attribute__((always_inline))
39 typedef signed char SInt8;
40 typedef unsigned int UInt32;
46 void CopyCStringToPascal( const char* src, unsigned char dst[256]);
47 void CopyPascalStringToC( const unsigned char* src, char* dst);
50 typedef struct AbsoluteTime
56 AbsoluteTime UpTime(); // NOTE: returns time since app started, not system start
58 typedef long Duration;
62 durationMicrosecond = -1,
63 durationMillisecond = 1,
64 durationSecond = 1000,
65 durationMinute = 1000 * 60,
66 durationHour = 1000 * 60 * 60,
67 durationDay = 1000 * 60 * 60 * 24,
68 durationForever = 0x7FFFFFFF,
69 durationImmediate = 0,
72 Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b);
75 inline bool isnormal( double x)
77 int ret = _fpclass( x);
78 return (ret == _FPCLASS_NN || ret == _FPCLASS_PN);
82 typedef unsigned int uintptr_t;
85 // fix file names to use '/' instead of ':'
86 char* ConvertFileName( const char* orgfilename, const char *mode = "rb" );
88 #define fopen( a, b) fopen(ConvertFileName(a, b), b)
90 inline float abs( float f)
97 inline double abs( double f)
104 __forceinline long long longlongabs( long long f)