JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
bumped version number
[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 #define NONE (~0)
8
9 #ifndef max
10 #define max(a, b) ((a) > (b) ? (a) : (b))
11 #endif
12
13 #ifndef min
14 #define min(a, b) ((a) < (b) ? (a) : (b))
15 #endif
16
17 #ifndef abs
18 #define abs(a) ((a)<=0 ? -(a) : (a))
19 #endif
20
21 #define CONDERROR(a) if((a)) {initerror = strdup(SDL_GetError());return 1;}
22 #define NULLERROR(a) CONDERROR((a) == NULL)
23
24 #endif // VOR_COMMON_H