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)
25 #define __forceinline inline __attribute__((always_inline))
38 typedef signed char SInt8;
39 typedef unsigned int UInt32;
45 void CopyCStringToPascal( const char* src, unsigned char dst[256]);
46 void CopyPascalStringToC( const unsigned char* src, char* dst);
49 typedef struct AbsoluteTime
55 AbsoluteTime UpTime(); // NOTE: returns time since app started, not system start
57 typedef long Duration;
61 durationMicrosecond = -1,
62 durationMillisecond = 1,
63 durationSecond = 1000,
64 durationMinute = 1000 * 60,
65 durationHour = 1000 * 60 * 60,
66 durationDay = 1000 * 60 * 60 * 24,
67 durationForever = 0x7FFFFFFF,
68 durationImmediate = 0,
71 Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b);
74 inline bool isnormal( double x)
76 int ret = _fpclass( x);
77 return (ret == _FPCLASS_NN || ret == _FPCLASS_PN);
81 typedef unsigned int uintptr_t;
84 // fix file names to use '/' instead of ':'
85 char* ConvertFileName( const char* orgfilename);
87 #define fopen( a, b) fopen( ConvertFileName( a), b);
89 inline float abs( float f)
96 inline double abs( double f)
103 __forceinline long long longlongabs( long long f)