From ec8248e10cd5848da6473282caab690c9ed44c89 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 2 Apr 2025 22:25:03 +0800 Subject: [PATCH] Windows logging compatibility --- thermion_dart/native/include/Log.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/thermion_dart/native/include/Log.hpp b/thermion_dart/native/include/Log.hpp index 3f2cf171..302c1b47 100644 --- a/thermion_dart/native/include/Log.hpp +++ b/thermion_dart/native/include/Log.hpp @@ -30,6 +30,12 @@ static void Log(const char *fmt, ...) { va_end(args); } + + +#if defined(_WIN32) || defined(_WIN64) +#define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) +#endif + #define ERROR(fmt, ...) Log("Error: %s:%d " fmt, __FILENAME__, __LINE__, ##__VA_ARGS__) #ifdef ENABLE_TRACING #ifdef __ANDROID__