Skip to content

Instantly share code, notes, and snippets.

@cygx

cygx/bugfix.h Secret

Created November 16, 2015 11:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cygx/aae672dcb8eb8a5ed0c5 to your computer and use it in GitHub Desktop.
Save cygx/aae672dcb8eb8a5ed0c5 to your computer and use it in GitHub Desktop.
/* BUGFIX: Pass a NULL argument instead of the frame pointer to the setjmp
* implementation to make the JIT not choke on exceptions on MinGW.
*/
#ifdef __MINGW32__
# ifndef USE_NO_MINGW_SETJMP_TWO_ARGS
# undef setjmp
# ifndef _INC_SETJMPEX
# ifdef _WIN64
# define setjmp(BUF) _setjmp((BUF), NULL)
# else
# define setjmp(BUF) _setjmp3((BUF), NULL)
# endif
# else
# define setjmp(BUF) _setjmpex((BUF), NULL)
# define setjmpex(BUF) _setjmpex((BUF), NULL)
# endif
# endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment