Skip to content
Browse files

Merge branch '1.6' of github.com:larskanis/fxruby into 1.6

  • Loading branch information...
2 parents cd0a20f + 6ba8ecf commit 24b941e7cc4b324bf95d77b3a20e651b92306fc1 @larskanis committed
Showing with 18 additions and 17 deletions.
  1. +3 −3 ext/fox16_c/FXRbApp.cpp
  2. +13 −13 ext/fox16_c/FXRuby.cpp
  3. +2 −1 ext/fox16_c/extconf.rb
View
6 ext/fox16_c/FXRbApp.cpp
@@ -26,7 +26,7 @@
#include "FXRbCommon.h"
-#ifndef RUBY_1_9
+#if defined(RUBY_1_8)
extern "C" {
#include "rubysig.h" /* For CHECK_INTS */
}
@@ -97,14 +97,14 @@ long FXRbApp::onChoreThreads(FXObject*,FXSelector,void*){
wait.tv_usec=100*sleepTime;
// Confirm that this thread can be interrupted, then go to sleep
-#ifndef RUBY_1_9
+#if defined(RUBY_1_8)
CHECK_INTS;
if(!rb_thread_critical)
rb_thread_wait_for(wait);
#else
// if(!rb_thread_critical) rb_thread_wait_for(wait);
rb_thread_wait_for(wait);
-#endif /* RUBY_1_9 */
+#endif /* RUBY_1_8 */
// Re-register this chore for next time
addChore(this,ID_CHORE_THREADS);
View
26 ext/fox16_c/FXRuby.cpp
@@ -39,19 +39,19 @@
#include <signal.h> // for definitions of SIGINT, etc.
#endif
-#ifdef RUBY_1_9
-
-#include "ruby/io.h"
-#include "ruby/st.h"
-
-#else
+#if defined(RUBY_1_8)
extern "C" {
#include "st.h"
#include "rubyio.h" // for GetOpenFile(), etc.
}
-#endif /* RUBY_1_9 */
+#else
+
+#include "ruby/io.h"
+#include "ruby/st.h"
+
+#endif /* RUBY_1_8 */
// Opaque type declaration from SWIG runtime
@@ -204,17 +204,17 @@ FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
VALUE vwrite = rb_intern("@write");
if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
-#elif defined(RUBY_1_9)
+#elif defined(RUBY_1_8)
+ OpenFile *fptr;
+ GetOpenFile(obj, fptr);
+ FILE *fpw=GetWriteFile(fptr);
+ fd = fileno(fpw);
+#else
rb_io_t *fptr;
GetOpenFile(obj, fptr);
VALUE wrio = fptr->tied_io_for_writing;
if(wrio) obj = wrio;
fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
-#else
- OpenFile *fptr;
- GetOpenFile(obj, fptr);
- FILE *fpw=GetWriteFile(fptr);
- fd = fileno(fpw);
#endif
#ifdef WIN32
#ifdef __CYGWIN__
View
3 ext/fox16_c/extconf.rb
@@ -145,8 +145,9 @@ def do_rake_compiler_setup
# Platform-specific modifications
do_rake_compiler_setup
-# Check for Ruby 1.9
+$CFLAGS += " -DRUBY_1_8" if RUBY_VERSION =~ /1\.8\./
$CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
+$CFLAGS += " -DRUBY_2_0" if RUBY_VERSION =~ /2\.0\./
# Last step: build the makefile
create_makefile("fox16_c")

0 comments on commit 24b941e

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