summaryrefslogtreecommitdiff
path: root/ext/ffi_c/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ffi_c/compat.h')
-rw-r--r--ext/ffi_c/compat.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/ffi_c/compat.h b/ext/ffi_c/compat.h
index 3f7bbae..889a4be 100644
--- a/ext/ffi_c/compat.h
+++ b/ext/ffi_c/compat.h
@@ -79,4 +79,13 @@
# define RB_GC_GUARD(x) (x)
#endif
+#ifdef HAVE_RB_GC_MARK_MOVABLE
+#define ffi_compact_callback(x) .dcompact = (x),
+#define ffi_gc_location(x) x = rb_gc_location(x)
+#else
+#define rb_gc_mark_movable(x) rb_gc_mark(x)
+#define ffi_compact_callback(x)
+#define ffi_gc_location(x)
+#endif
+
#endif /* RBFFI_COMPAT_H */