Skip to content
Browse files

Build under Ruby 1.9

  • Loading branch information...
1 parent 470f4f0 commit ca5a4b77aa9a1b9634be9a1e126aaa2fbbb3aabc @aredridel aredridel committed Sep 18, 2007
Showing with 6 additions and 2 deletions.
  1. +4 −2 ext/inotify.c
  2. +2 −0 extconf.rb
View
6 ext/inotify.c
@@ -1,6 +1,8 @@
#include <ruby.h>
#include <rubyio.h>
+#ifdef HAVE_VERSION_H
#include <version.h>
+#endif
#ifdef HAVE_LINUX_INOTIFY_H
#include <asm/unistd.h>
@@ -77,7 +79,7 @@ static VALUE rb_inotify_new(VALUE klass) {
*/
static VALUE rb_inotify_add_watch(VALUE self, VALUE filename, VALUE mask) {
-#if RUBY_VERSION_CODE >= 190
+#ifndef HAVE_TYPE_OPENFILE
rb_io_t *fptr;
#else
OpenFile *fptr;
@@ -113,7 +115,7 @@ static VALUE rb_inotify_rm_watch(VALUE self, VALUE wdnum) {
*/
static VALUE rb_inotify_each_event(VALUE self) {
-#if RUBY_VERSION_CODE >= 190
+#ifndef HAVE_TYPE_OPENFILE
rb_io_t *fptr;
#else
OpenFile *fptr;
View
2 extconf.rb
@@ -1,4 +1,6 @@
require 'mkmf'
have_header('linux/inotify.h')
+have_header("version.h")
+have_type("OpenFile", ["ruby.h", "rubyio.h"])
create_makefile('inotify', 'ext')

0 comments on commit ca5a4b7

Please sign in to comment.
Something went wrong with that request. Please try again.