[前][次][番号順一覧][スレッド一覧]

ruby-changes:65718

From: Tom <ko1@a...>
Date: Wed, 31 Mar 2021 18:07:22 +0900 (JST)
Subject: [ruby-changes:65718] 8b2f2a707d (master): [ruby/openssl] Use #ifdef consistently for HAVE_RB_EXT_RACTOR_SAFE

https://git.ruby-lang.org/ruby.git/commit/?id=8b2f2a707d

From 8b2f2a707de54ad24d787ff0bce67ed8c68cdded Mon Sep 17 00:00:00 2001
From: Tom Stuart <tom.stuart@s...>
Date: Thu, 25 Mar 2021 17:42:59 +0000
Subject: [ruby/openssl] Use #ifdef consistently for HAVE_RB_EXT_RACTOR_SAFE

We previously used a mix of both `#if` and `#ifdef`, but the latter is
more reliable because it will still work if the macro is undefined.

https://github.com/ruby/openssl/commit/e4a622e67e
---
 ext/openssl/ossl.c    | 2 +-
 ext/openssl/ossl_bn.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 7bdf3a2..70b6a6a 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -1129,7 +1129,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L1129
 void
 Init_openssl(void)
 {
-#if HAVE_RB_EXT_RACTOR_SAFE
+#ifdef HAVE_RB_EXT_RACTOR_SAFE
     rb_ext_ractor_safe(true);
 #endif
 
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index bec3729..1d43e45 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -10,7 +10,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_bn.c#L10
 /* modified by Michal Rokos <m.rokos@s...> */
 #include "ossl.h"
 
-#if HAVE_RB_EXT_RACTOR_SAFE
+#ifdef HAVE_RB_EXT_RACTOR_SAFE
 #include <ruby/ractor.h>
 #endif
 
@@ -155,7 +155,7 @@ ossl_bn_value_ptr(volatile VALUE *ptr) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_bn.c#L155
  * Private
  */
 
-#if HAVE_RB_EXT_RACTOR_SAFE
+#ifdef HAVE_RB_EXT_RACTOR_SAFE
 void
 ossl_bn_ctx_free(void *ptr)
 {
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]