summaryrefslogtreecommitdiff
path: root/include/ruby/internal/abi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/abi.h')
-rw-r--r--include/ruby/internal/abi.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h
index 78ed4c1875..7ceb8c40b7 100644
--- a/include/ruby/internal/abi.h
+++ b/include/ruby/internal/abi.h
@@ -1,6 +1,8 @@
#ifndef RUBY_ABI_H
#define RUBY_ABI_H
+#ifdef RUBY_ABI_VERSION /* should match the definition in config.h */
+
/* This number represents Ruby's ABI version.
*
* In development Ruby, it should be bumped every time an ABI incompatible
@@ -19,26 +21,37 @@
* - Backwards compatible refactors.
* - Editing comments.
*
- * In released versions of Ruby, this number should not be changed since teeny
+ * In released versions of Ruby, this number is not defined since teeny
* versions of Ruby should guarantee ABI compatibility.
*/
-#define RUBY_ABI_VERSION 0
+#define RUBY_ABI_VERSION 3
/* Windows does not support weak symbols so ruby_abi_version will not exist
* in the shared library. */
-#if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__)
-# define RUBY_DLN_CHECK_ABI 1
-#else
-# define RUBY_DLN_CHECK_ABI 0
+#if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
+# define RUBY_DLN_CHECK_ABI
#endif
+#endif /* RUBY_ABI_VERSION */
+
+#if defined(RUBY_DLN_CHECK_ABI) && !defined(RUBY_EXPORT)
-#if RUBY_DLN_CHECK_ABI
+# ifdef __cplusplus
+extern "C" {
+# endif
RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak))
ruby_abi_version(void)
{
+# ifdef RUBY_ABI_VERSION
return RUBY_ABI_VERSION;
+# else
+ return 0;
+# endif
+}
+
+# ifdef __cplusplus
}
+# endif
#endif