diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2011-02-13 22:19:46 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2011-02-13 22:19:46 +0000 |
commit | 7d700cc99996ca32379eeaf0f5c919c39dfa37ba (patch) | |
tree | cc1a012d4b2ca461f1e399299aab0f4cc8dc57e4 | |
parent | fb6f48dda42379ccd46ea1933ede0ebd99ab309a (diff) | |
download | swig-7d700cc99996ca32379eeaf0f5c919c39dfa37ba.tar.gz |
patch #3176274 - Ruby typecheck typemap for time_t.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12459 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | CHANGES.current | 3 | ||||
-rw-r--r-- | Lib/ruby/timeval.i | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES.current b/CHANGES.current index df3bc7e0e..8ae8b784f 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -6,6 +6,9 @@ Version 2.0.2 (in progress) =========================== 2011-02-13: wsfulton + [Ruby] Apply patch #3176274 from James Masters - typecheck typemap for time_t. + +2011-02-13: wsfulton Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used. 2011-02-13: wsfulton diff --git a/Lib/ruby/timeval.i b/Lib/ruby/timeval.i index 91b56916f..e7bc2d322 100644 --- a/Lib/ruby/timeval.i +++ b/Lib/ruby/timeval.i @@ -58,6 +58,11 @@ struct timeval rb_time_timeval(VALUE); $1 = NUM2LONG(rb_funcall($input, rb_intern("tv_sec"), 0)); } +%typemap(typecheck) time_t +{ + $1 = (NIL_P($input) || TYPE(rb_funcall($input, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("tv_sec")))) == T_TRUE); +} + %typemap(out) time_t { $result = rb_time_new($1, 0); |