From 638fd8774bed27b997f3b634ba8be7aa304be3c3 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 18 Feb 2022 11:05:52 -0500 Subject: [PATCH] [Feature #18249] Include ruby.h in extensions to have ABI version All shared libraries must have `include/ruby/internal/abi.h` to include the ABI version. Including `ruby.h` will guarantee that. --- enc/encinit.c.erb | 1 + enc/trans/transdb.c | 2 ++ ext/-test-/load/dot.dot/dot.dot.c | 2 ++ regenc.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/enc/encinit.c.erb b/enc/encinit.c.erb index 70c2a1934c..120408f8e3 100644 --- a/enc/encinit.c.erb +++ b/enc/encinit.c.erb @@ -2,6 +2,7 @@ * Author: yugui@google.com (Yugui Sonoda) */ #include +#include "ruby.h" #define init(func, name) { \ extern void func(void); \ diff --git a/enc/trans/transdb.c b/enc/trans/transdb.c index d6ac41e967..7caf8d845d 100644 --- a/enc/trans/transdb.c +++ b/enc/trans/transdb.c @@ -9,6 +9,8 @@ **********************************************************************/ +#include "ruby.h" + void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib); void diff --git a/ext/-test-/load/dot.dot/dot.dot.c b/ext/-test-/load/dot.dot/dot.dot.c index 936d28931a..ce7563bf8d 100644 --- a/ext/-test-/load/dot.dot/dot.dot.c +++ b/ext/-test-/load/dot.dot/dot.dot.c @@ -1 +1,3 @@ +#include "ruby.h" + void Init_dot(void) {} diff --git a/regenc.h b/regenc.h index 16ed6c39da..bc1365058e 100644 --- a/regenc.h +++ b/regenc.h @@ -51,6 +51,8 @@ # undef ONIG_ESCAPE_UCHAR_COLLISION #endif +#include "ruby.h" + #ifdef RUBY # include "ruby/onigmo.h" #else