diff --git a/bindings/ruby/sfml-window/window/Window.cpp b/bindings/ruby/sfml-window/window/Window.cpp index 043a7049f..d0c4ee2fa 100644 --- a/bindings/ruby/sfml-window/window/Window.cpp +++ b/bindings/ruby/sfml-window/window/Window.cpp @@ -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! */ diff --git a/bindings/ruby/sfml-window/window/main.hpp b/bindings/ruby/sfml-window/window/main.hpp index f3e77023b..8be00af76 100644 --- a/bindings/ruby/sfml-window/window/main.hpp +++ b/bindings/ruby/sfml-window/window/main.hpp @@ -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__ )