From 128972189284f4338722e8a910d0b4f6e7a02b31 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 1 Mar 2022 13:38:48 -0500 Subject: [PATCH] Wrap ruby_abi_version in `extern "C"` for C++ Make ruby_abi_version have C linkage so that the symbol can be found in the shared object. --- include/ruby/internal/abi.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h index 81899dcd31..7a6caa6e2e 100644 --- a/include/ruby/internal/abi.h +++ b/include/ruby/internal/abi.h @@ -32,12 +32,20 @@ #ifdef RUBY_DLN_CHECK_ABI +# ifdef __cplusplus +extern "C" { +# endif + RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak)) ruby_abi_version(void) { return RUBY_ABI_VERSION; } +# ifdef __cplusplus +} +# endif + #endif #endif