Attemp #2 at defining rb_eNullReferenceError. This is done for C++, but for C
a more generic rb_eRuntimeError is thrown instead. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8333 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
31ad1e3a8a
commit
180a2372dc
1 changed files with 10 additions and 0 deletions
|
|
@ -6,6 +6,12 @@
|
|||
|
||||
%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) {
|
||||
VALUE type;
|
||||
|
|
@ -44,7 +50,11 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
|
|||
type = rb_eRuntimeError;
|
||||
break;
|
||||
case SWIG_NullReferenceError:
|
||||
#ifdef __cplusplus
|
||||
type = rb_eNullReferenceError;
|
||||
#else
|
||||
type = rb_eRuntimeError;
|
||||
#endif
|
||||
break;
|
||||
case SWIG_UnknownError:
|
||||
type = rb_eRuntimeError;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue