Fix compilation on MSVC
* cast scalar value instead of function * use `rb_pid_t` for the portability
This commit is contained in:
parent
e880d075f8
commit
25a332f5cf
@ -73,19 +73,14 @@ static void* blocking_gvl_func_for_udf_io(void *data) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||
#endif
|
||||
|
||||
static VALUE thread_spec_rb_thread_call_without_gvl_native_function(VALUE self) {
|
||||
pid_t ret = (pid_t) (long) rb_thread_call_without_gvl((void *(*)(void *)) getpid, 0, RUBY_UBF_IO, 0);
|
||||
return LONG2FIX(ret);
|
||||
static void* ubf_pid(void *_) {
|
||||
return (void *) (SIGNED_VALUE) getpid();
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
static VALUE thread_spec_rb_thread_call_without_gvl_native_function(VALUE self) {
|
||||
rb_pid_t ret = (rb_pid_t) (SIGNED_VALUE) rb_thread_call_without_gvl(ubf_pid, 0, RUBY_UBF_IO, 0);
|
||||
return LONG2FIX(ret);
|
||||
}
|
||||
|
||||
/* Returns true if the thread is interrupted. */
|
||||
static VALUE thread_spec_rb_thread_call_without_gvl_with_ubf_io(VALUE self) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user