From 1886fe99afbb42c72a9c525adf08d49034c75101 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 29 May 2024 23:11:59 +0200 Subject: [PATCH] src: use __FUNCSIG__ on Windows in backtrace To show function signature if possible. PR-URL: https://github.com/nodejs/node/pull/53135 Refs: https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli Reviewed-By: Chengzhong Wu Reviewed-By: Stefan Stojanovic --- src/util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.h b/src/util.h index e50930aa7ab4ae..a0cee453ee43a7 100644 --- a/src/util.h +++ b/src/util.h @@ -163,8 +163,12 @@ void DumpJavaScriptBacktrace(FILE* fp); #else #define LIKELY(expr) expr #define UNLIKELY(expr) expr +#if defined(_MSC_VER) +#define PRETTY_FUNCTION_NAME __FUNCSIG__ +#else #define PRETTY_FUNCTION_NAME "" #endif +#endif #define STRINGIFY_(x) #x #define STRINGIFY(x) STRINGIFY_(x)