Skip to content

Commit

Permalink
Use __builtin_setjmp, for MinGW gcc
Browse files Browse the repository at this point in the history
As per http://www.agardner.me/golang/windows/cgo/64-bit/setjmp/longjmp/2016/02/29/go-windows-setjmp-x86.html

This makes the module build and test 100% OK with Strawberry Perl on Win64
directly from CPAN.

Ideally, the setjmp change would also be communicated to the upstream
Duktape maintainers, but I don't know their build process and how I can
figure out what genconfig.py does.
  • Loading branch information
Max Maischein committed Dec 16, 2017
1 parent bf6c1e7 commit 5644fca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/JavaScript/Duktape/C/lib/duk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@
/* MinGW. Also GCC flags (DUK_F_GCC) are enabled now. */
#if defined(__MINGW32__) || defined(__MINGW64__)
#define DUK_F_MINGW

/* Use __builtin_setjmp, for MinGW gcc, as per */
/* http://www.agardner.me/golang/windows/cgo/64-bit/setjmp/longjmp/2016/02/29/go-windows-setjmp-x86.html */

#define DUK_JMPBUF_TYPE jmp_buf
#define DUK_SETJMP(jb) __builtin_setjmp((jb))
#define DUK_LONGJMP(jb) __builtin_longjmp((jb), 1)
#endif

/* MSVC */
Expand Down

0 comments on commit 5644fca

Please sign in to comment.