diff --git a/gba/Makefile b/gba/Makefile index f86d67c..6334668 100644 --- a/gba/Makefile +++ b/gba/Makefile @@ -33,7 +33,7 @@ CFLAGS := -g -Wall -O2\ -ffast-math \ $(ARCH) -CFLAGS += $(INCLUDE) -DGBA +CFLAGS += $(INCLUDE) -D__GBA__ CXXFLAGS := $(CFLAGS) ASFLAGS := -g $(ARCH) diff --git a/include/fat.h b/include/fat.h index 7d828f6..d8fa794 100644 --- a/include/fat.h +++ b/include/fat.h @@ -38,10 +38,10 @@ extern "C" { #include "libfatversion.h" -// When compiling for NDS, make sure NDS is defined -#ifndef NDS - #if defined ARM9 || defined ARM7 - #define NDS +// When compiling for NDS, make sure __NDS__ is defined, as old Makefiles don't define it +#if !defined __NDS__ && !defined __GBA__ + #if defined NDS || defined ARM9 || defined ARM7 + #define __NDS__ #endif #endif @@ -50,7 +50,7 @@ extern "C" { #if defined(__gamecube__) || defined (__wii__) # include #else -# ifdef NDS +# ifdef __NDS__ # include # else # include diff --git a/nds/Makefile b/nds/Makefile index 8d50737..2a15e85 100644 --- a/nds/Makefile +++ b/nds/Makefile @@ -32,7 +32,7 @@ CFLAGS := -g -Wall -O2 \ -ffast-math \ $(ARCH) -CFLAGS += $(INCLUDE) -DARM9 -DNDS +CFLAGS += $(INCLUDE) -DARM9 -D__NDS__ CXXFLAGS := $(CFLAGS) ASFLAGS := -g $(ARCH) diff --git a/source/common.h b/source/common.h index d5a58f6..27f4288 100644 --- a/source/common.h +++ b/source/common.h @@ -33,23 +33,16 @@ #include #include -// When compiling for NDS, make sure NDS is defined -#ifndef NDS - #if defined ARM9 || defined ARM7 - #define NDS - #endif -#endif - // Platform specific includes #if defined(__gamecube__) || defined (__wii__) #include #include #include -#elif defined(NDS) +#elif defined(__NDS__) #include #include #include -#elif defined(GBA) +#elif defined(__GBA__) #include #include #elif defined(GP2X) @@ -68,11 +61,11 @@ #define DEFAULT_SECTORS_PAGE 64 #define USE_LWP_LOCK #define USE_RTC_TIME -#elif defined (NDS) +#elif defined (__NDS__) #define DEFAULT_CACHE_PAGES 16 #define DEFAULT_SECTORS_PAGE 8 #define USE_RTC_TIME -#elif defined (GBA) +#elif defined (__GBA__) #define DEFAULT_CACHE_PAGES 2 #define DEFAULT_SECTORS_PAGE 8 #define LIMIT_SECTORS 128 diff --git a/source/disc.c b/source/disc.c index f923fd0..2f65643 100755 --- a/source/disc.c +++ b/source/disc.c @@ -91,7 +91,7 @@ const INTERFACE_ID _FAT_disc_interfaces[] = { }; /* ====================== NDS ====================== */ -#elif defined (NDS) +#elif defined (__NDS__) #include #include #include @@ -103,7 +103,7 @@ const INTERFACE_ID _FAT_disc_interfaces[] = { }; /* ====================== GBA ====================== */ -#elif defined (GBA) +#elif defined (__GBA__) #include const INTERFACE_ID _FAT_disc_interfaces[] = {