X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FPlatform%2FPlatform.hpp;h=4004cef25b75285ab048f4170da6cfa5d2e2616c;hp=7b03008fd26b3c5d105be6512b4b123be96182a4;hb=6a8cb464330e92163c8feaf101b8b5837c973bba;hpb=5fca41ab430df85d6dd620a7f4130df01bc1430f diff --git a/Source/Platform/Platform.hpp b/Source/Platform/Platform.hpp index 7b03008..4004cef 100644 --- a/Source/Platform/Platform.hpp +++ b/Source/Platform/Platform.hpp @@ -28,11 +28,11 @@ along with Lugaru. If not, see . #include #if defined(WIN32) && !defined(strcasecmp) -#define strcasecmp(a,b) stricmp(a,b) +#define strcasecmp(a, b) stricmp(a, b) #endif - -struct Point { +struct Point +{ short v; short h; }; @@ -40,9 +40,10 @@ struct Point { typedef signed char SInt8; typedef unsigned int UInt32; -typedef struct AbsoluteTime { - unsigned long hi; - unsigned long lo; +typedef struct AbsoluteTime +{ + unsigned long hi; + unsigned long lo; } AbsoluteTime; /* Returns time since the app started, not system start. */ @@ -50,27 +51,27 @@ AbsoluteTime UpTime(); typedef long Duration; -enum { +enum +{ durationMicrosecond = -1, durationMillisecond = 1, - durationSecond = 1000, - durationMinute = 1000 * 60, - durationHour = 1000 * 60 * 60, - durationDay = 1000 * 60 * 60 * 24, - durationForever = 0x7FFFFFFF, - durationImmediate = 0, + durationSecond = 1000, + durationMinute = 1000 * 60, + durationHour = 1000 * 60 * 60, + durationDay = 1000 * 60 * 60 * 24, + durationForever = 0x7FFFFFFF, + durationImmediate = 0, }; Duration AbsoluteDeltaToDuration(AbsoluteTime& a, AbsoluteTime& b); - /* Workaround missing math stuff on MSVC * FIXME: Check that it is still necessary nowadays. */ #ifdef _MSC_VER -inline bool isnormal( double x) +inline bool isnormal(double x) { - int ret = _fpclass( x); + int ret = _fpclass(x); return (ret == _FPCLASS_NN || ret == _FPCLASS_PN); }