ext/jsonnet/vm.c in jsonnet-0.4.0 vs ext/jsonnet/vm.c in jsonnet-0.5.0
- old
+ new
@@ -5,10 +5,14 @@
#include <ruby/ruby.h>
#include <ruby/intern.h>
#include "ruby_jsonnet.h"
+#ifndef NORETURN
+# define NORETURN(x) x
+#endif
+
/*
* defines the core part of Jsonnet::VM
*/
/*
@@ -383,11 +387,11 @@
}
void
rubyjsonnet_init_vm(VALUE mJsonnet)
{
- cVM = rb_define_class_under(mJsonnet, "VM", rb_cData);
+ cVM = rb_define_class_under(mJsonnet, "VM", rb_cObject);
rb_define_singleton_method(cVM, "new", vm_s_new, -1);
rb_define_private_method(cVM, "eval_file", vm_evaluate_file, 3);
rb_define_private_method(cVM, "eval_snippet", vm_evaluate, 3);
rb_define_private_method(cVM, "fmt_file", vm_fmt_file, 2);
rb_define_private_method(cVM, "fmt_snippet", vm_fmt_snippet, 2);
@@ -422,11 +426,11 @@
eEvaluationError = rb_define_class_under(mJsonnet, "EvaluationError", rb_eRuntimeError);
eFormatError = rb_define_class_under(mJsonnet, "FormatError", rb_eRuntimeError);
}
static void
-raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
+NORETURN(raise_error)(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
{
VALUE ex;
const int state = rubyjsonnet_jump_tag(msg);
if (state) {
/*
@@ -449,16 +453,16 @@
* @return never returns
* @throw EvaluationError
* @sa rescue_callback
*/
static void
-raise_eval_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
+NORETURN(raise_eval_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
{
raise_error(eEvaluationError, vm, msg, enc);
}
static void
-raise_format_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
+NORETURN(raise_format_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
{
raise_error(eFormatError, vm, msg, enc);
}
/**