Use __SWITCH__ rather than SWITCH

This commit is contained in:
Dave Murphy 2018-03-10 23:35:26 +00:00 committed by plutoo
parent 7d5617254a
commit 27d195e118
7 changed files with 13 additions and 13 deletions

View File

@ -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

View File

@ -14,7 +14,7 @@
#include <malloc.h>
#endif
#include <math.h>
#ifdef SWITCH
#ifdef __SWITCH__
#include <switch.h>
#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)

View File

@ -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

View File

@ -1,5 +1,5 @@
#pragma once
#ifdef SWITCH
#ifdef __SWITCH__
#include <switch.h>
#endif

View File

@ -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];

View File

@ -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)

View File

@ -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];