diff --git a/ext/texplay/bindings.c b/ext/texplay/bindings.c index 9475f4f..0775063 100644 --- a/ext/texplay/bindings.c +++ b/ext/texplay/bindings.c @@ -308,7 +308,7 @@ m_clone_image(VALUE self) cloned_image = m_dup_image(self); - #if RUBY_API_VERSION_MAJOR <= 1 || (RUBY_API_VERSION_MAJOR == 2 && RUBY_API_VERSION_MINOR >= 0) + #if RUBY_API_VERSION_MAJOR <= 1 || (RUBY_API_VERSION_MAJOR >= 2) /* the main diff b/w clone and dup is that clone also dups the singleton */ rb_obj_reveal(cloned_image, rb_singleton_class_clone(self)); #else diff --git a/ext/texplay/texplay.h b/ext/texplay/texplay.h index ef32c1b..904bbd5 100644 --- a/ext/texplay/texplay.h +++ b/ext/texplay/texplay.h @@ -28,9 +28,13 @@ #define ABS(X) ((X) >= 0 ? (X) : -(X)) /* enums */ +#ifdef __bool_true_false_are_defined +/* Newer Ruby versions already include stdbool.h */ +#else typedef enum e_bool { false, true } bool; +#endif typedef enum e_color { red, green, blue, alpha