JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
oops, didn't fix bang dots correctly.
[vor.git] / common.h
index ac9d87e..b0f32ff 100644 (file)
--- a/common.h
+++ b/common.h
@@ -1,17 +1,10 @@
 #ifndef VOR_COMMON_H
 #define VOR_COMMON_H
 
-#ifndef NULL
-#define NULL 0
-#endif
+#include <stdbool.h>
+#include <stddef.h>
 
-#ifndef true
-#define true 1
-#endif
-
-#ifndef false
-#define false 0
-#endif
+#define NONE (~0)
 
 #ifndef max
 #define max(a, b) ((a) > (b) ? (a) : (b))
@@ -25,4 +18,7 @@
 #define abs(a) ((a)<=0 ? -(a) : (a))
 #endif
 
+#define CONDERROR(a) if((a)) {initerror = strdup(SDL_GetError());return 1;}
+#define NULLERROR(a) CONDERROR((a) == NULL)
+
 #endif // VOR_COMMON_H