summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2015-05-25 21:19:24 +0900
committertake_cheeze <[email protected]>2015-05-25 21:19:24 +0900
commit6498d90f1be9564e75d34d94d61374fb98b7c01c (patch)
treeaad59db11c251868252062ed5683a6d89fae508f /src
parentf70905491008ec9657f706dd2183afc13d49cc10 (diff)
downloadmruby-6498d90f1be9564e75d34d94d61374fb98b7c01c.tar.gz
mruby-6498d90f1be9564e75d34d94d61374fb98b7c01c.zip
Move "src/mrb_throw.h" to "include/mruby/throw.h".
Related to #2760.
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c2
-rw-r--r--src/error.c2
-rw-r--r--src/mrb_throw.h41
-rw-r--r--src/parse.y2
-rw-r--r--src/vm.c2
5 files changed, 4 insertions, 45 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 8b3cf7806..222dec9b6 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -17,7 +17,7 @@
#include "node.h"
#include "mruby/opcode.h"
#include "mruby/re.h"
-#include "mrb_throw.h"
+#include "mruby/throw.h"
typedef mrb_ast_node node;
typedef struct mrb_parser_state parser_state;
diff --git a/src/error.c b/src/error.c
index 3fa49853a..a800f77f9 100644
--- a/src/error.c
+++ b/src/error.c
@@ -16,7 +16,7 @@
#include "mruby/debug.h"
#include "mruby/error.h"
#include "mruby/class.h"
-#include "mrb_throw.h"
+#include "mruby/throw.h"
MRB_API mrb_value
mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, size_t len)
diff --git a/src/mrb_throw.h b/src/mrb_throw.h
deleted file mode 100644
index 3c7407a8d..000000000
--- a/src/mrb_throw.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-** mrb_throw.h - mruby exception throwing handler
-**
-** See Copyright Notice in mruby.h
-*/
-
-#ifndef MRB_THROW_H
-#define MRB_THROW_H
-
-#ifdef MRB_ENABLE_CXX_EXCEPTION
-
-#define MRB_TRY(buf) do { try {
-#define MRB_CATCH(buf) } catch(mrb_jmpbuf_impl e) { if (e != (buf)->impl) { throw e; }
-#define MRB_END_EXC(buf) } } while(0)
-
-#define MRB_THROW(buf) throw((buf)->impl)
-typedef mrb_int mrb_jmpbuf_impl;
-
-#else
-
-#include <setjmp.h>
-
-#define MRB_TRY(buf) do { if (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_jmpbuf_impl jmp_buf
-
-#endif
-
-struct mrb_jmpbuf {
- mrb_jmpbuf_impl impl;
-
-#ifdef MRB_ENABLE_CXX_EXCEPTION
- static mrb_int jmpbuf_id;
- mrb_jmpbuf() : impl(jmpbuf_id++) {}
-#endif
-};
-
-#endif /* MRB_THROW_H */
diff --git a/src/parse.y b/src/parse.y
index 0ed78d7e3..76220499e 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -27,7 +27,7 @@
#include "mruby/proc.h"
#include "mruby/error.h"
#include "node.h"
-#include "mrb_throw.h"
+#include "mruby/throw.h"
#define YYLEX_PARAM p
diff --git a/src/vm.c b/src/vm.c
index a6324cf93..dd0d0ba43 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -20,7 +20,7 @@
#include "mruby/error.h"
#include "mruby/opcode.h"
#include "value_array.h"
-#include "mrb_throw.h"
+#include "mruby/throw.h"
#ifndef ENABLE_STDIO
#if defined(__cplusplus)