Skip to content

Commit c313fa4

Browse files
committed
Use workaround of __builtin_setjmp only on MINGW on MSVCRT
MSVCRT is not present Windows/ARM64 and the workaround is not necessary on any UCRT based toolchain. Author: Lars Kanis <lars@greiz-reinsdorf.de> Discussion: https://postgr.es/m/CAHXCYb2OjNHtoGVKyXtXmw4B3bUXwJX6M-Lcp1KcMCRUMLOocA@mail.gmail.com
1 parent e19dc74 commit c313fa4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/include/c.h

Lines changed: 5 additions & 5 deletions
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 has some longstanding issues in its setjmp support when
1330+
* building with MSVCRT, 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy