Fixed some C/C++ compiler errors due to stricter checks.
[rubinius.git] / machine / exception_point.hpp
blob91b919cfe0631145e9a7bf37cc798e1d54c6ac22
1 #ifndef RBX_EXCEPTION_POINT_HPP
2 #define RBX_EXCEPTION_POINT_HPP
4 #include <setjmp.h>
6 #include "windows_compat.h"
8 namespace rubinius {
9 class NativeMethodEnvironment;
11 class ExceptionPoint {
12 bool jumped_to_;
13 ExceptionPoint* previous_;
15 public:
16 jmp_buf __jump_buffer;
17 const char* file;
18 int line;
20 public:
21 ExceptionPoint(NativeMethodEnvironment* env);
23 bool jumped_to() const {
24 return jumped_to_;
27 void reset() {
28 jumped_to_ = false;
31 void return_to(NativeMethodEnvironment* env);
33 void unwind_to_previous(NativeMethodEnvironment* env) {
34 previous_->return_to(env);
37 void pop(NativeMethodEnvironment* env);
41 #define PLACE_EXCEPTION_POINT(ep) ep.file = __FILE__; ep.line = __LINE__; set_jump(ep.__jump_buffer)
43 #endif