Skip to content

Commit fe47814

Browse files
larskanisCommitfest Bot
authored and
Commitfest Bot
committed
Use workaround of __builtin_setjmp only on MINGW on MSVCRT
Because it is not present on ARM64 on Windows and not necessary on any UCRT based toolchain.
1 parent d6d8054 commit fe47814

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/include/c.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1326,19 +1326,19 @@ extern int fdatasync(int fildes);
13261326
/*
13271327
* When there is no sigsetjmp, its functionality is provided by plain
13281328
* setjmp. We now support the case only on Windows. However, it seems
1329-
* that MinGW-64 has some longstanding issues in its setjmp support,
1330-
* so on that toolchain we cheat and use gcc's builtins.
1329+
* that MinGW-64 on x86_64 has some longstanding issues in its setjmp
1330+
* support, so on that toolchain we cheat and use gcc's builtins.
13311331
*/
13321332
#ifdef WIN32
1333-
#ifdef __MINGW64__
1333+
#if defined(__MINGW64__) && !defined(_UCRT)
13341334
typedef intptr_t sigjmp_buf[5];
13351335
#define sigsetjmp(x,y) __builtin_setjmp(x)
13361336
#define siglongjmp __builtin_longjmp
1337-
#else /* !__MINGW64__ */
1337+
#else /* !defined(__MINGW64__) || defined(_UCRT) */
13381338
#define sigjmp_buf jmp_buf
13391339
#define sigsetjmp(x,y) setjmp(x)
13401340
#define siglongjmp longjmp
1341-
#endif /* __MINGW64__ */
1341+
#endif /* defined(__MINGW64__) && !defined(_UCRT) */
13421342
#endif /* WIN32 */
13431343

13441344
/* /port compatibility functions */

0 commit comments

Comments
 (0)