Commit 4683b89b authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #3068 from kazuho/kazuho/osx-_setjmp

use _setjmp/_longjmp on OS X
parents 38b9c2d3 121c6e30
......@@ -20,11 +20,19 @@ typedef mrb_int mrb_jmpbuf_impl;
#include <setjmp.h>
#define MRB_TRY(buf) do { if (setjmp((buf)->impl) == 0) {
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define MRB_SETJMP _setjmp
#define MRB_LONGJMP _longjmp
#else
#define MRB_SETJMP setjmp
#define MRB_LONGJMP longjmp
#endif
#define MRB_TRY(buf) do { if (MRB_SETJMP((buf)->impl) == 0) {
#define MRB_CATCH(buf) } else {
#define MRB_END_EXC(buf) } } while(0)
#define MRB_THROW(buf) longjmp((buf)->impl, 1);
#define MRB_THROW(buf) MRB_LONGJMP((buf)->impl, 1);
#define mrb_jmpbuf_impl jmp_buf
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment