Moved VALIDATE_CLASS to main.hpp and changed so it considers heritage too.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1661 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
groogy 2010-11-16 20:12:35 +00:00
parent 784c8ca80b
commit abd49f55a1
2 changed files with 6 additions and 6 deletions

View File

@ -33,12 +33,6 @@ extern VALUE globalEventClass;
extern VALUE globalInputClass; extern VALUE globalInputClass;
extern VALUE globalVector2Class; extern VALUE globalVector2Class;
#define VALIDATE_CLASS( variable, type, name ) \
if( CLASS_OF( variable ) != type ) \
{ \
rb_raise( rb_eTypeError, "%s argument must be instance of %s", name, rb_string_value_cstr ( &type ) ); \
}
/* Free a heap allocated object /* Free a heap allocated object
* Not accessible trough ruby directly! * Not accessible trough ruby directly!
*/ */

View File

@ -30,6 +30,12 @@ extern "C" void Init_window( void );
typedef VALUE ( *RubyFunctionPtr )( ... ); typedef VALUE ( *RubyFunctionPtr )( ... );
#define VALIDATE_CLASS( variable, type, name ) \
if( rb_obj_is_kind_of( variable, type ) != Qtrue ) \
{ \
rb_raise( rb_eTypeError, "%s argument must be instance of %s", name, rb_string_value_cstr ( &type ) ); \
}
#define rb_define_singleton_method( klass, name, func, argc, ... ) rb_define_singleton_method( klass, name, reinterpret_cast< RubyFunctionPtr >( func ), argc, ##__VA_ARGS__ ) #define rb_define_singleton_method( klass, name, func, argc, ... ) rb_define_singleton_method( klass, name, reinterpret_cast< RubyFunctionPtr >( func ), argc, ##__VA_ARGS__ )
#define rb_define_method( klass, name, func, argc, ... ) rb_define_method( klass, name, reinterpret_cast< RubyFunctionPtr >( func ), argc, ##__VA_ARGS__ ) #define rb_define_method( klass, name, func, argc, ... ) rb_define_method( klass, name, reinterpret_cast< RubyFunctionPtr >( func ), argc, ##__VA_ARGS__ )