From bf6b6eff34efb93b5e698606bf160badcb88086d Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Tue, 15 Nov 2022 12:44:58 +0900 Subject: [PATCH] universal7885: aidl-support: Cut off dirs on __FILE__ --- universal7885-common/apps/aidl-support/include/LogFormat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/universal7885-common/apps/aidl-support/include/LogFormat.h b/universal7885-common/apps/aidl-support/include/LogFormat.h index 7c22422..13b3257 100644 --- a/universal7885-common/apps/aidl-support/include/LogFormat.h +++ b/universal7885-common/apps/aidl-support/include/LogFormat.h @@ -3,9 +3,12 @@ #ifdef LOG_TAG +#include #include -#define make_str(a, ...) _make_str(__FILE__, __LINE__, a, ##__VA_ARGS__).c_str() +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + +#define make_str(a, ...) _make_str(__FILENAME__, __LINE__, a, ##__VA_ARGS__).c_str() // Helpers to avoid -Wformat-security #define LOG_E(fmt, ...) ALOGE("%s", make_str(fmt, ##__VA_ARGS__))