From: cfis <cf...@us...> - 2006-01-09 22:17:13
|
Update of /cvsroot/swig/SWIG/Lib/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25220 Modified Files: rubyerrors.swg Log Message: Attemp #2 at defining rb_eNullReferenceError. This is done for C++, but for C a more generic rb_eRuntimeError is thrown instead. Index: rubyerrors.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/ruby/rubyerrors.swg,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rubyerrors.swg 9 Jan 2006 20:11:37 -0000 1.5 --- rubyerrors.swg 9 Jan 2006 22:17:06 -0000 1.6 *************** *** 7,10 **** --- 7,16 ---- %insert("header") %{ + #ifdef __cplusplus + /* Define custom error for SWIG_NullReferenceError since Ruby does not have a + built-in error that seems appropriate. */ + static VALUE rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError); + #endif + SWIGINTERN VALUE SWIG_Ruby_ErrorType(int SWIG_code) { *************** *** 45,49 **** --- 51,59 ---- break; case SWIG_NullReferenceError: + #ifdef __cplusplus + type = rb_eNullReferenceError; + #else type = rb_eRuntimeError; + #endif break; case SWIG_UnknownError: |