JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
minor rearrangements and the beginnings of a Windows port.
[vor.git] / common.h
1 #ifndef VOR_COMMON_H
2 #define VOR_COMMON_H
3
4 #include <stdbool.h>
5 #include <stddef.h>
6
7 #ifndef max
8 #define max(a, b) ((a) > (b) ? (a) : (b))
9 #endif
10
11 #ifndef min
12 #define min(a, b) ((a) < (b) ? (a) : (b))
13 #endif
14
15 #ifndef abs
16 #define abs(a) ((a)<=0 ? -(a) : (a))
17 #endif
18
19 #define CONDERROR(a) if((a)) {initerror = strdup(SDL_GetError());return 1;}
20 #define NULLERROR(a) CONDERROR((a) == NULL)
21
22 #ifdef WIN32
23 # include <windows.h>
24 #endif
25
26 #endif // VOR_COMMON_H