diff --git a/Makefile.nx b/Makefile.nx index 1c1c64d..2f8cbd4 100644 --- a/Makefile.nx +++ b/Makefile.nx @@ -16,7 +16,7 @@ include $(DEVKITPRO)/libnx/switch_rules # DATA is a list of directories containing data files # INCLUDES is a list of directories containing header files # EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm". -# +# # NO_ICON: if set to anything, do not use icon. # NO_NACP: if set to anything, no .nacp file is generated. # APP_TITLE is the name of the app stored in the .nacp file (Optional) @@ -46,7 +46,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -DSWITCH -DVERSION=\"$(APP_VERSION)\" +CFLAGS += $(INCLUDE) -D__SWITCH__ -DVERSION=\"$(APP_VERSION)\" CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 diff --git a/common/common.h b/common/common.h index ab41fa1..bc39791 100644 --- a/common/common.h +++ b/common/common.h @@ -14,7 +14,7 @@ #include #endif #include -#ifdef SWITCH +#ifdef __SWITCH__ #include #endif @@ -43,7 +43,7 @@ typedef union { #include "theme.h" // when building for pc we need to include nro.h separately -#ifndef SWITCH +#ifndef __SWITCH__ #include "nro.h" #endif @@ -66,7 +66,7 @@ static inline color_t MakeColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) return clr; } -#ifdef SWITCH +#ifdef __SWITCH__ extern uint8_t* g_framebuf; extern u32 g_framebuf_width; static inline void DrawPixel(uint32_t x, uint32_t y, color_t clr) diff --git a/common/language.c b/common/language.c index b9d7740..2204969 100644 --- a/common/language.c +++ b/common/language.c @@ -1,6 +1,6 @@ #include "language.h" -#ifdef SWITCH +#ifdef __SWITCH__ #define STR_JP(_str) [SetLanguage_JA] = _str #define STR_EN(_str) [SetLanguage_ENUS] = _str, [SetLanguage_ENGB] = _str #define STR_FR(_str) [SetLanguage_FR] = _str, [SetLanguage_FRCA] = _str diff --git a/common/language.h b/common/language.h index f49474e..56bc31a 100644 --- a/common/language.h +++ b/common/language.h @@ -1,5 +1,5 @@ #pragma once -#ifdef SWITCH +#ifdef __SWITCH__ #include #endif diff --git a/common/menu-list.c b/common/menu-list.c index d3551c2..abbceea 100644 --- a/common/menu-list.c +++ b/common/menu-list.c @@ -106,7 +106,7 @@ int menuScan(const char* target) { memset(tmp_path, 0, sizeof(tmp_path)); snprintf(tmp_path, sizeof(tmp_path)-1, "%s/%s", s_menu[!s_curMenu].dirname, dp->d_name); - #ifdef SWITCH + #ifdef __SWITCH__ fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct; FsDirectoryEntry* entry = &dirSt->entry_data[dirSt->index]; diff --git a/common/menu.c b/common/menu.c index 5ee8bb4..20c5cda 100644 --- a/common/menu.c +++ b/common/menu.c @@ -221,7 +221,7 @@ void computeFrontGradient(color_t baseColor, int height) { void menuStartup() { const char *path; - #ifdef SWITCH + #ifdef __SWITCH__ path = "sdmc:/switch"; #else path = "switch"; @@ -305,7 +305,7 @@ void drawBackBtn(menu_s* menu, bool emptyDir) { x_text = 1280 - 90 - 30 - 32; } - #ifdef SWITCH + #ifdef __SWITCH__ if (strcmp( menu->dirname, "sdmc:/") != 0) #else if (strcmp( menu->dirname, "/") != 0) diff --git a/common/text.c b/common/text.c index 783e5a0..69e5094 100644 --- a/common/text.c +++ b/common/text.c @@ -1,13 +1,13 @@ #include "text.h" -#ifdef SWITCH +#ifdef __SWITCH__ static int s_textLang = SetLanguage_ENUS; #else static int s_textLang = 1; #endif void textInit(void) { - #ifdef SWITCH + #ifdef __SWITCH__ //u64 LanguageCode=0; //s32 Language=0; @@ -29,7 +29,7 @@ int textGetLang(void) { const char* textGetString(StrId id) { const char* str = g_strings[id][s_textLang]; - #ifdef SWITCH + #ifdef __SWITCH__ if (!str) str = g_strings[id][SetLanguage_ENUS]; #else if (!str) str = g_strings[id][1];