mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 06:41:05 +08:00
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:
parent
784c8ca80b
commit
abd49f55a1
@ -33,12 +33,6 @@ extern VALUE globalEventClass;
|
||||
extern VALUE globalInputClass;
|
||||
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
|
||||
* Not accessible trough ruby directly!
|
||||
*/
|
||||
|
@ -30,6 +30,12 @@ extern "C" void Init_window( void );
|
||||
|
||||
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_method( klass, name, func, argc, ... ) rb_define_method( klass, name, reinterpret_cast< RubyFunctionPtr >( func ), argc, ##__VA_ARGS__ )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user