From eb4bdbf27a2950e39f6570b91acb9d80e354ca7b Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Thu, 29 Jun 2023 19:08:48 +0200 Subject: [PATCH] nxdt_log: use __FILE__ macro Takes advantage of the -fmacro-prefix-map option from GCC8+. Also updated libusbhsfs again. --- Makefile | 15 ++------------- include/core/nxdt_log.h | 6 +++--- libs/libusbhsfs | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index b444261..96d943d 100644 --- a/Makefile +++ b/Makefile @@ -89,8 +89,9 @@ CFLAGS += -DVERSION_MAJOR=${VERSION_MAJOR} -DVERSION_MINOR=${VERSION_MINOR} -DV CFLAGS += -DAPP_TITLE=\"${APP_TITLE}\" -DAPP_AUTHOR=\"${APP_AUTHOR}\" -DAPP_VERSION=\"${APP_VERSION}\" CFLAGS += -DGIT_BRANCH=\"${GIT_BRANCH}\" -DGIT_COMMIT=\"${GIT_COMMIT}\" -DGIT_REV=\"${GIT_REV}\" CFLAGS += -DBUILD_TIMESTAMP="\"${BUILD_TIMESTAMP}\"" -DBOREALIS_RESOURCES="\"${BOREALIS_RESOURCES}\"" -D_GNU_SOURCE +CFLAGS += -fmacro-prefix-map=$(ROOTDIR)= -CXXFLAGS := $(CFLAGS) -std=c++20 -Wno-volatile -Wno-unused-parameter +CXXFLAGS := $(CFLAGS) -std=c++20 ASFLAGS := -g $(ARCH) LDFLAGS := -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) @@ -249,18 +250,6 @@ $(OUTPUT).elf : $(OFILES) $(OFILES_SRC) : $(HFILES_BIN) -#--------------------------------------------------------------------------------- -# Overrides for devkitA64/base_rules targets. -#--------------------------------------------------------------------------------- - -%.o: %.cpp - $(SILENTMSG) $(notdir $<) - $(SILENTCMD)$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -D__FILENAME__="\"$(subst $(ROOTDIR),,$(realpath $<))\"" -c $< -o $@ $(ERROR_FILTER) - -%.o: %.c - $(SILENTMSG) $(notdir $<) - $(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -D__FILENAME__="\"$(subst $(ROOTDIR),,$(realpath $<))\"" -c $< -o $@ $(ERROR_FILTER) - #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data #--------------------------------------------------------------------------------- diff --git a/include/core/nxdt_log.h b/include/core/nxdt_log.h index a7335e8..b67670f 100644 --- a/include/core/nxdt_log.h +++ b/include/core/nxdt_log.h @@ -44,9 +44,9 @@ extern "C" { /// Helper macros. -#define LOG_MSG_GENERIC(level, fmt, ...) logWriteFormattedStringToLogFile(level, __FILENAME__, __LINE__, __func__, fmt, ##__VA_ARGS__) -#define LOG_MSG_BUF_GENERIC(dst, dst_size, level, fmt, ...) logWriteFormattedStringToBuffer(dst, dst_size, level, __FILENAME__, __LINE__, __func__, fmt, ##__VA_ARGS__) -#define LOG_DATA_GENERIC(data, data_size, level, fmt, ...) logWriteBinaryDataToLogFile(data, data_size, level, __FILENAME__, __LINE__, __func__, fmt, ##__VA_ARGS__) +#define LOG_MSG_GENERIC(level, fmt, ...) logWriteFormattedStringToLogFile(level, __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__) +#define LOG_MSG_BUF_GENERIC(dst, dst_size, level, fmt, ...) logWriteFormattedStringToBuffer(dst, dst_size, level, __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__) +#define LOG_DATA_GENERIC(data, data_size, level, fmt, ...) logWriteBinaryDataToLogFile(data, data_size, level, __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__) #if LOG_LEVEL == LOG_LEVEL_DEBUG #define LOG_MSG_DEBUG(fmt, ...) LOG_MSG_GENERIC(LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__) diff --git a/libs/libusbhsfs b/libs/libusbhsfs index 972bddf..55f5a14 160000 --- a/libs/libusbhsfs +++ b/libs/libusbhsfs @@ -1 +1 @@ -Subproject commit 972bddf8967e801569d809b776a8d1c9acb606c2 +Subproject commit 55f5a140770b10899e3c5e3a08243471fe8e9ba7