From fb06e4a3c94ae17b73df6d3aecf2d18213aa183e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 26 Jun 2019 08:13:38 -0400 Subject: Modernize code Can compile with arm-none-eabi-gcc 8.3.0 gbafix correctly handles ELF input --- include/global.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 969680dd7..712a40866 100644 --- a/include/global.h +++ b/include/global.h @@ -62,6 +62,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) -- cgit v1.2.3 From e92e9a184ccfa2aa3a226610d6c4e633e8082c10 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 28 Jun 2019 22:26:11 -0400 Subject: Support for non-dkA toolchains --- include/global.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/global.h') diff --git a/include/global.h b/include/global.h index 712a40866..a76d6e4e3 100644 --- a/include/global.h +++ b/include/global.h @@ -2,6 +2,7 @@ #define GUARD_GLOBAL_H #include +#include #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" -- cgit v1.2.3