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
This commit is contained in:
parent
fb6f48dda4
commit
7d700cc999
2 changed files with 8 additions and 0 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue