Skip to content

Commit 7832225

Browse files
committed
Fix for Windows
1 parent d24dd46 commit 7832225

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ext/pycall/ruby_wrapper.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,16 @@ PyRuby_getattro_with_gvl(PyRubyObject *pyro, PyObject *pyobj_name)
356356

357357
VALUE cPyRubyPtr;
358358

359-
const rb_data_type_t pycall_pyrubyptr_data_type = {
359+
static rb_data_type_t pycall_pyrubyptr_data_type = {
360360
"PyCall::PyRubyPtr",
361361
{ 0, pycall_pyptr_free, pycall_pyptr_memsize, },
362362
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
363-
&pycall_pyptr_data_type, 0, RUBY_TYPED_FREE_IMMEDIATELY
363+
# if defined _WIN32 && !defined __CYGWIN__
364+
0,
365+
# else
366+
&pycall_pyptr_data_type,
367+
# endif
368+
0, RUBY_TYPED_FREE_IMMEDIATELY
364369
#endif
365370
};
366371

@@ -462,6 +467,10 @@ pycall_init_ruby_wrapper(void)
462467

463468
/* PyCall::PyRubyPtr */
464469

470+
#if defined _WIN32 && !defined __CYGWIN__
471+
pycall_pyrubyptr_data_type.parent = &pycall_pyptr_data_type;
472+
#endif
473+
465474
cPyRubyPtr = rb_define_class_under(mPyCall, "PyRubyPtr", cPyPtr);
466475
rb_define_alloc_func(cPyRubyPtr, pycall_pyruby_allocate);
467476
rb_define_method(cPyRubyPtr, "__ruby_object_id__", pycall_pyruby_get_ruby_object_id, 0);

0 commit comments

Comments
 (0)