summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-10-25 11:42:20 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-10-25 11:42:20 +0100
commit99e067eac6fd2babcdd56142493ef0396744af85 (patch)
tree9ba4989cc063a9f598390c8a42d3777d36bad3b2 /spec
parent148961adcd0704d964fce920330a6301b9704c25 (diff)
Try to fix compilation on MSVC
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/optional/capi/ext/thread_spec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/thread_spec.c b/spec/ruby/optional/capi/ext/thread_spec.c
index 53eae456b2..845c022fa1 100644
--- a/spec/ruby/optional/capi/ext/thread_spec.c
+++ b/spec/ruby/optional/capi/ext/thread_spec.c
@@ -73,13 +73,19 @@ 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);
}
+
+#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
+#endif
/* Returns true if the thread is interrupted. */
static VALUE thread_spec_rb_thread_call_without_gvl_with_ubf_io(VALUE self) {