summaryrefslogtreecommitdiff
path: root/libguile/setjump-win.h
blob: bf06e868b98ce55179ad1cf9da6a4b9b0f424712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _SCM_SETJUMP_WIN_H_
#define _SCM_SETJUMP_WIN_H_

#include <setjmp.h>

/* On Windows, `setjmp` expands to _setjmp, which takes a second
   parameter that is set to the current frame address by default.
   The address is then stored as first element in the jump buffer.
   When `longjmp` is called, it tries to unwind the stack up
   to the saved address, which will fail, if the stack frames are
   interwoven with JIT-generated code.
   Set the second parameter to NULL to prevent unwinding. */
#undef setjmp
#define setjmp(env) _setjmp(env, NULL)

#endif /* _SCM_SETJUMP_WIN_H_ */