summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--includes/common.h8
-rw-r--r--includes/compiler/CError.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/includes/common.h b/includes/common.h
index 9ea51fb..baedfe9 100644
--- a/includes/common.h
+++ b/includes/common.h
@@ -29,7 +29,15 @@
#define CW_INLINE inline
+// format string specifiers
+#define PRIxPTR "lx"
+
+#define PRIx32 "lx"
+#define PRIX32 "lX"
+#define PRId32 "ld"
+
#else
+#include <inttypes.h>
#include <stdarg.h>
// expand this to nothing
#define CW_PASCAL
diff --git a/includes/compiler/CError.h b/includes/compiler/CError.h
index 754bdef..8eaefd9 100644
--- a/includes/compiler/CError.h
+++ b/includes/compiler/CError.h
@@ -3,8 +3,8 @@
#include "compiler/common.h"
-#define CError_ASSERT(line, cond) if (!(cond)) { CError_Internal(__FILE__, line); }
-#define CError_FAIL(line, cond) if (cond) { CError_Internal(__FILE__, line); }
+#define CError_ASSERT(line, cond) do { if (!(cond)) { CError_Internal(__FILE__, line); } } while (0)
+#define CError_FAIL(line, cond) do { if (cond) { CError_Internal(__FILE__, line); } } while (0)
#define CError_FATAL(line) do { CError_Internal(__FILE__, line); } while (0)
enum {