Skip to content

Commit 51e6ce3

Browse files
committed
[UCRT] Add GCC compatible __FUNCTIONW__
1 parent 589bbca commit 51e6ce3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sdk/include/ucrt/corecrt.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,18 @@ extern "C++"
280280
#define _CRT_SIZE_MAX ((size_t)-1)
281281

282282
#define __FILEW__ _CRT_WIDE(__FILE__)
283+
284+
#ifdef _MSC_VER
283285
#define __FUNCTIONW__ _CRT_WIDE(__FUNCTION__)
286+
#else // _MSC_VER
287+
#define __FUNCTIONW__ \
288+
({ \
289+
static wchar_t __funcw__[sizeof(__func__)]; \
290+
for (size_t i = 0; i < sizeof(__func__); i++) \
291+
__funcw__[i] = __func__[i]; \
292+
__funcw__; \
293+
})
294+
#endif // _MSC_VER
284295

285296
#ifdef __cplusplus
286297
#ifndef _STATIC_ASSERT

0 commit comments

Comments
 (0)