2 Copyright (C) 2003, 2010 - Wolfire Games
4 This file is part of Lugaru.
6 Lugaru is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 Lugaru is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
28 // stuff to make Mac code compatable with Windows
31 // disable warnings about double to float conversions
32 #pragma warning(disable:4305)
33 #pragma warning(disable:4244)
35 // disable warnings about boolean to int conversions
36 #pragma warning(disable:4800)
38 // disable warning about unreferenced local variables
39 #pragma warning(disable:4101)
46 typedef signed char SInt8;
47 typedef unsigned int UInt32;
53 typedef struct AbsoluteTime {
58 AbsoluteTime UpTime(); // NOTE: returns time since app started, not system start
60 typedef long Duration;
63 durationMicrosecond = -1,
64 durationMillisecond = 1,
65 durationSecond = 1000,
66 durationMinute = 1000 * 60,
67 durationHour = 1000 * 60 * 60,
68 durationDay = 1000 * 60 * 60 * 24,
69 durationForever = 0x7FFFFFFF,
70 durationImmediate = 0,
73 Duration AbsoluteDeltaToDuration( AbsoluteTime& a, AbsoluteTime& b);
77 inline bool isnormal( double x)
79 int ret = _fpclass( x);
80 return (ret == _FPCLASS_NN || ret == _FPCLASS_PN);
85 // fix file names to use '/' instead of ':'
86 char* ConvertFileName( const char* orgfilename);
87 char* ConvertFileName( const char* orgfilename, const char* junk);
90 #define fopen(a, b) fopen(ConvertFileName(a), b);
93 inline float abs(float f)
100 inline double abs(double f)
106 #endif // __MINGW32__