summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/fiddle.c4
-rw-r--r--ext/fiddle/fiddle.h4
-rw-r--r--ext/fiddle/memory_view.c4
-rw-r--r--ext/fiddle/pointer.c6
4 files changed, 7 insertions, 11 deletions
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index dd819a298ca..a8b5123269c 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -7,7 +7,7 @@ VALUE rb_eFiddleError;
void Init_fiddle_pointer(void);
void Init_fiddle_pinned(void);
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
void Init_fiddle_memory_view(void);
#endif
@@ -546,7 +546,7 @@ Init_fiddle(void)
Init_fiddle_pointer();
Init_fiddle_pinned();
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
Init_fiddle_memory_view();
#endif
}
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h
index 823689e0910..bf97b59d538 100644
--- a/ext/fiddle/fiddle.h
+++ b/ext/fiddle/fiddle.h
@@ -189,10 +189,6 @@
#define ALIGN_INT32_T ALIGN_OF(int32_t)
#define ALIGN_INT64_T ALIGN_OF(int64_t)
-#ifdef HAVE_RUBY_MEMORY_VIEW_H
-# define FIDDLE_MEMORY_VIEW
-#endif
-
extern VALUE mFiddle;
extern VALUE rb_eFiddleDLError;
diff --git a/ext/fiddle/memory_view.c b/ext/fiddle/memory_view.c
index c9df5fd2bd7..fa66fc2c7b2 100644
--- a/ext/fiddle/memory_view.c
+++ b/ext/fiddle/memory_view.c
@@ -1,6 +1,6 @@
#include <fiddle.h>
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
#include <stdbool.h>
#include <ruby/ruby.h>
@@ -318,4 +318,4 @@ Init_fiddle_memory_view(void)
rb_define_method(rb_cMemoryView, "to_s", rb_fiddle_memview_to_s, 0);
}
-#endif /* FIDDLE_MEMORY_VIEW */
+#endif /* HAVE_RUBY_MEMORY_VIEW_H */
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 9d05c137b05..15107e3862c 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -9,7 +9,7 @@
#include <ctype.h>
#include <fiddle.h>
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
# include <ruby/memory_view.h>
#endif
@@ -92,7 +92,7 @@ static const rb_data_type_t fiddle_ptr_data_type = {
{fiddle_ptr_mark, fiddle_ptr_free, fiddle_ptr_memsize,},
};
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
static struct ptr_data *
fiddle_ptr_check_memory_view(VALUE obj)
{
@@ -841,7 +841,7 @@ Init_fiddle_pointer(void)
rb_define_method(rb_cPointer, "size", rb_fiddle_ptr_size_get, 0);
rb_define_method(rb_cPointer, "size=", rb_fiddle_ptr_size_set, 1);
-#ifdef FIDDLE_MEMORY_VIEW
+#ifdef HAVE_RUBY_MEMORY_VIEW_H
rb_memory_view_register(rb_cPointer, &fiddle_ptr_memory_view_entry);
#endif