rua 0.4.4-mswin32 → 0.4.5-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/ext/rua.c +22 -9
  2. data/lib/i386-mswin32/rua.so +0 -0
  3. metadata +3 -3
data/ext/rua.c CHANGED
@@ -9,14 +9,15 @@ __declspec(dllexport) void Init_rua(void);
9
9
  #include <errno.h>
10
10
  #include <stdarg.h>
11
11
 
12
- #include "ruby.h"
13
-
14
12
  #include "lua.h"
15
13
  #include "lualib.h"
16
14
  #include "lauxlib.h"
17
15
 
18
16
  #include "iconv.h"
19
17
 
18
+ #include "ruby.h"
19
+ #include "rubysig.h"
20
+
20
21
  #include "rua.h"
21
22
 
22
23
  #ifndef RSTRING_PTR
@@ -35,7 +36,7 @@ __declspec(dllexport) void Init_rua(void);
35
36
  #define RARRAY_LEN(s) (RARRAY(s)->len)
36
37
  #endif
37
38
 
38
- #define VERSION "0.4.4"
39
+ #define VERSION "0.4.5"
39
40
  #define REF_RBOBJ "self"
40
41
 
41
42
  #define ICONV_JIS "ISO-2022-JP"
@@ -292,7 +293,7 @@ static VALUE rua_eval(VALUE self, VALUE str) {
292
293
  struct rua *p;
293
294
  VALUE errinfo;
294
295
  const char *errmsg;
295
- int pretop;
296
+ int pretop, result = -1;
296
297
 
297
298
  Check_Type(str, T_STRING);
298
299
  Data_Get_Struct(self, struct rua, p);
@@ -304,7 +305,11 @@ static VALUE rua_eval(VALUE self, VALUE str) {
304
305
  pretop = lua_gettop(p->L);
305
306
  luaL_loadstring(p->L, RSTRING_PTR(str));
306
307
 
307
- if (lua_pcall(p->L, 0, LUA_MULTRET, 0) != 0) {
308
+ TRAP_BEG;
309
+ result = lua_pcall(p->L, 0, LUA_MULTRET, 0);
310
+ TRAP_END;
311
+
312
+ if (result != 0) {
308
313
  if (lua_islightuserdata(p->L, -1)) {
309
314
  errinfo = (VALUE) lua_touserdata(p->L, -1);
310
315
  lua_pop(p->L, 1);
@@ -557,7 +562,7 @@ static VALUE rua_func_initialize(VALUE self) {
557
562
  */
558
563
  static VALUE rua_func_call(int argc, VALUE *argv, VALUE self) {
559
564
  struct rua_ref *p;
560
- int pretop, i;
565
+ int pretop, i, result = -1;
561
566
  VALUE errinfo;
562
567
  const char *errmsg;
563
568
 
@@ -569,7 +574,11 @@ static VALUE rua_func_call(int argc, VALUE *argv, VALUE self) {
569
574
  rua_pushrbval(p->L, argv[i], p->R);
570
575
  }
571
576
 
572
- if (lua_pcall(p->L, argc, LUA_MULTRET, 0) != 0) {
577
+ TRAP_BEG;
578
+ result = lua_pcall(p->L, argc, LUA_MULTRET, 0);
579
+ TRAP_END;
580
+
581
+ if (result != 0) {
573
582
  if (lua_islightuserdata(p->L, -1)) {
574
583
  errinfo = (VALUE) lua_touserdata(p->L, -1);
575
584
  lua_pop(p->L, 1);
@@ -622,7 +631,7 @@ static VALUE rua_thread_initialize(VALUE self) {
622
631
  static VALUE rua_thread_resume(int argc, VALUE *argv, VALUE self) {
623
632
  struct rua_ref *p;
624
633
  VALUE retval, errinfo;
625
- int pretop, i;
634
+ int pretop, i, result = -1;
626
635
  const char *errmsg;
627
636
 
628
637
  Data_Get_Struct(self, struct rua_ref, p);
@@ -636,7 +645,11 @@ static VALUE rua_thread_resume(int argc, VALUE *argv, VALUE self) {
636
645
  rua_pushrbval(p->L, argv[i], p->R);
637
646
  }
638
647
 
639
- if (lua_pcall(p->L, argc + 1, LUA_MULTRET, 0) != 0) {
648
+ TRAP_BEG;
649
+ result = lua_pcall(p->L, argc + 1, LUA_MULTRET, 0);
650
+ TRAP_END;
651
+
652
+ if (result != 0) {
640
653
  if (lua_islightuserdata(p->L, -1)) {
641
654
  errinfo = (VALUE) lua_touserdata(p->L, -1);
642
655
  lua_pop(p->L, 2);
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rua
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: mswin32
6
6
  authors:
7
7
  - winebarrel
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-09 00:00:00 +09:00
12
+ date: 2008-09-15 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  requirements: []
50
50
 
51
51
  rubyforge_project: rua
52
- rubygems_version: 1.1.1
52
+ rubygems_version: 1.2.0
53
53
  signing_key:
54
54
  specification_version: 2
55
55
  summary: Rua is a library for using Lua under Ruby.