From abd49f55a128a28e15b9dc1248fe5a08f1190687 Mon Sep 17 00:00:00 2001 From: groogy Date: Tue, 16 Nov 2010 20:12:35 +0000 Subject: [PATCH] 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 --- bindings/ruby/sfml-window/window/Window.cpp | 6 ------ bindings/ruby/sfml-window/window/main.hpp | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) 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__ )