summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index 969680dd7..a76d6e4e3 100644
--- a/include/global.h
+++ b/include/global.h
@@ -2,6 +2,7 @@
#define GUARD_GLOBAL_H
#include <string.h>
+#include <limits.h>
#include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
#include "gba/gba.h"
#include "constants/global.h"
@@ -62,6 +63,10 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
+#if MODERN
+#define abs(x) (((x) < 0) ? -(x) : (x))
+#endif
+
// Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)