From 81309f27011e43f0a90dde372dc61a46c5d9a74a Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 29 May 2023 16:05:22 +0900 Subject: [PATCH] Fix detection? --- ext/openssl/extconf.rb | 3 +-- ext/openssl/ossl_ssl.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index afd5bfefa..ef21bd5f4 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -18,8 +18,6 @@ Logging::message "=== OpenSSL for Ruby configurator ===\n" -have_func("rb_io_descriptor") - ## # Adds -DOSSL_DEBUG for compilation and some more targets when GCC is used # To turn it on, use: --with-debug or --enable-debug @@ -29,6 +27,7 @@ end $defs.push("-D""OPENSSL_SUPPRESS_DEPRECATED") +have_func("rb_io_descriptor") have_func("rb_io_maybe_wait(0, Qnil, Qnil, Qnil)", "ruby/io.h") # Ruby 3.1 Logging::message "=== Checking for system dependent stuff... ===\n" diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 5a27b0175..b5bd508c7 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1655,12 +1655,13 @@ ossl_ssl_initialize(int argc, VALUE *argv, VALUE self) #ifndef HAVE_RB_IO_DESCRIPTOR static int -rb_io_descriptor(VALUE io) +io_descriptor_fallback(VALUE io) { rb_io_t *fptr; GetOpenFile(io, fptr); return fptr->fd; } +#define rb_io_descriptor io_descriptor_fallback #endif static VALUE