summaryrefslogtreecommitdiff
path: root/ext/fiddle/pointer.c
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2021-07-05 10:45:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-13 19:37:46 +0900
commitbb868f4814c09c978f20f224c5e99656bc8b9bee (patch)
tree0bfeb0e7494510d244c8cf21b830d69059d13f6c /ext/fiddle/pointer.c
parent5c0d8c6369f92915bf99924f58f0763abe4f493e (diff)
[ruby/fiddle] Use have_header and have_type to detect memory view availability
Fix https://github.com/ruby/fiddle/pull/84 It may detect ruby/memory_view.h for system Ruby that is installed in /usr. We can use RUBY_API_VERSION_MAJOR to detect memory view availability because memory view is available since Ruby 3.0. Reported by Jun Aruga. Thanks!!! https://github.com/ruby/fiddle/commit/3292929830
Diffstat (limited to 'ext/fiddle/pointer.c')
-rw-r--r--ext/fiddle/pointer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 9336f0431c..ae9eb166ec 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -6,13 +6,13 @@
#include <ruby/ruby.h>
#include <ruby/io.h>
-#ifdef HAVE_RUBY_MEMORY_VIEW_H
-# include <ruby/memory_view.h>
-#endif
-
#include <ctype.h>
#include <fiddle.h>
+#ifdef FIDDLE_MEMORY_VIEW
+# include <ruby/memory_view.h>
+#endif
+
#ifdef PRIsVALUE
# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
# define RB_OBJ_STRING(obj) (obj)