X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Ftypes.h;h=6f86c02888b007b884136da1bbdaad4c6b3b3cac;hb=1f0d80712e543e4d664ffe9a1f672db34207e7b9;hp=62752f1fe8007ca150a4c3513a97c03e97cda56d;hpb=b641818c787e48bbf03ce2a0cd5b542c4c21e523;p=rocksndiamonds.git diff --git a/src/libgame/types.h b/src/libgame/types.h index 62752f1f..6f86c028 100644 --- a/src/libgame/types.h +++ b/src/libgame/types.h @@ -19,7 +19,7 @@ #include -#if !defined(PLATFORM_WIN32) +#if !defined(PLATFORM_WINDOWS) typedef int boolean; typedef unsigned char byte; #endif @@ -36,35 +36,41 @@ typedef unsigned char byte; #undef AUTO #endif -#define TRUE 1 -#define FALSE 0 -#define AUTO -1 +#define TRUE 1 +#define FALSE 0 +#define AUTO -1 #ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif #ifndef ABS -#define ABS(a) ((a) < 0 ? -(a) : (a)) +#define ABS(a) ((a) < 0 ? -(a) : (a)) #endif #ifndef SIGN -#define SIGN(a) ((a) < 0 ? -1 : ((a) > 0 ? 1 : 0)) +#define SIGN(a) ((a) < 0 ? -1 : ((a) > 0 ? 1 : 0)) #endif #ifndef ODD -#define ODD(a) (((a) & 1) == 1) +#define ODD(a) (((a) & 1) == 1) #endif #ifndef EVEN -#define EVEN(a) (((a) & 1) == 0) +#define EVEN(a) (((a) & 1) == 0) #endif -#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) +#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) + +#define PTR_TO_INT(p) ((int) (long) (p)) +#define PTR_TO_UINT(p) ((unsigned int) (unsigned long) (p)) + +#define INT_TO_PTR(i) ((void *) (long) (i)) +#define UINT_TO_PTR(u) ((void *) (unsigned long) (u)) struct ListNode @@ -76,4 +82,11 @@ struct ListNode }; typedef struct ListNode ListNode; +struct DelayCounter +{ + unsigned int value; + unsigned int count; +}; +typedef struct DelayCounter DelayCounter; + #endif // TYPES_H