Codebase list ruby-fxruby / e9733f2
Merge branch '1.6' of github.com:larskanis/fxruby into 1.6 Lars Kanis 4 years ago
5 changed file(s) with 8 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
2424 ***********************************************************************/
2525
2626 #include "FXRbCommon.h"
27
28 #if defined(RUBY_1_8)
29 extern "C" {
30 #include "rubysig.h" /* For CHECK_INTS */
31 }
32 #endif
3327
3428 #ifdef HAVE_SYS_TIME_H
3529 #include <sys/time.h> /* For struct timeval */
148142 wait.tv_sec=0;
149143 wait.tv_usec=100*sleepTime;
150144
151 // Confirm that this thread can be interrupted, then go to sleep
152 #if defined(RUBY_1_8)
153 CHECK_INTS;
154 if(!rb_thread_critical)
155 rb_thread_wait_for(wait);
156 #else
157 // if(!rb_thread_critical) rb_thread_wait_for(wait);
158145 rb_thread_wait_for(wait);
159 #endif /* RUBY_1_8 */
160146
161147 // Re-register this chore for next time
162148 addChore(this,ID_CHORE_THREADS);
4242 #include <signal.h> // for definitions of SIGINT, etc.
4343 #endif
4444
45 #if defined(RUBY_1_8)
46
47 extern "C" {
48 #include "st.h"
49 #include "rubyio.h" // for GetOpenFile(), etc.
50 }
51
52 #else
53
5445 #include "ruby/io.h"
5546 #include "ruby/st.h"
56
57 #endif /* RUBY_1_8 */
5847
5948
6049 // Opaque type declaration from SWIG runtime
16611650 VALUE vwrite = rb_intern("@write");
16621651 if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
16631652 fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1664 #elif defined(RUBY_1_8)
1665 OpenFile *fptr;
1666 GetOpenFile(obj, fptr);
1667 FILE *fpw=GetWriteFile(fptr);
1668 fd = fileno(fpw);
16691653 #else
16701654 rb_io_t *fptr;
16711655 GetOpenFile(obj, fptr);
308308 # Platform-specific modifications
309309 do_rake_compiler_setup
310310
311 $CFLAGS += " -DRUBY_1_8" if RUBY_VERSION =~ /1\.8\./
312 $CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
313 $CFLAGS += " -DRUBY_2_0" if RUBY_VERSION =~ /2\.0\./
314
315311 if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
316312 $CXXFLAGS += " -Wno-unused-function"
317313 $CXXFLAGS += " -Wno-maybe-uninitialized"
2323 * $Id: FXRbCommon.h 2303 2005-12-09 03:17:28Z lyle $
2424 ***********************************************************************/
2525
26 extern "C" {
2726 #include "ruby.h"
2827
2928 #include "extconf.h"
3130 #ifdef HAVE_RUBY_ENCODING_H
3231 #include "ruby/encoding.h"
3332 #endif
34 }
3533
3634 /**
3735 * The Ruby header files for Win32 redefine the symbol "select", which
1414 #ifndef __gvl_wrappers_h
1515 #define __gvl_wrappers_h
1616
17 extern "C" {
18 #if defined(HAVE_RB_THREAD_CALL_WITH_GVL)
19 extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
20 #endif
21
22 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
23 extern "C" void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
24 rb_unblock_function_t *ubf, void *data2);
25 #endif
26 }
17 #if defined(HAVE_RB_THREAD_CALL_WITH_GVL)
18 extern "C" void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
19 #endif
20
21 #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
22 extern "C" void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
23 rb_unblock_function_t *ubf, void *data2);
24 #endif
2725
2826 void fxrb_wakeup_fox(void *);
2927