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

ruby-changes:66042

From: Benoit <ko1@a...>
Date: Tue, 4 May 2021 21:57:15 +0900 (JST)
Subject: [ruby-changes:66042] 59a92a84c8 (master): Fix -Wundef warnings in core extensions

https://git.ruby-lang.org/ruby.git/commit/?id=59a92a84c8

From 59a92a84c8145c3dffd9f2a0e570dbc61211c86c Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Thu, 29 Apr 2021 15:02:19 +0200
Subject: Fix -Wundef warnings in core extensions

* See [Feature #17752]
---
 ext/nkf/nkf-utf8/nkf.h     | 4 ++--
 ext/openssl/ossl_pkey_ec.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ext/nkf/nkf-utf8/nkf.h b/ext/nkf/nkf-utf8/nkf.h
index cd30376..b3a520d 100644
--- a/ext/nkf/nkf-utf8/nkf.h
+++ b/ext/nkf/nkf-utf8/nkf.h
@@ -16,8 +16,8 @@ https://github.com/ruby/ruby/blob/trunk/ext/nkf/nkf-utf8/nkf.h#L16
 #define X0201_DEFAULT TRUE
 #endif
 
-#if DEFAULT_NEWLINE == 0x0D0A
-#elif DEFAULT_NEWLINE == 0x0D
+#if defined(DEFAULT_NEWLINE) && DEFAULT_NEWLINE == 0x0D0A
+#elif defined(DEFAULT_NEWLINE) && DEFAULT_NEWLINE == 0x0D
 #else
 #define DEFAULT_NEWLINE 0x0A
 #endif
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index deca4f4..be9b09c 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -1469,7 +1469,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_pkey_ec.c#L1469
 	if (EC_POINT_mul(group, point_result, bn_g, point_self, bn, ossl_bn_ctx) != 1)
 	    ossl_raise(eEC_POINT, NULL);
     } else {
-#if OPENSSL_VERSION_MAJOR+0 >= 3 || defined(LIBRESSL_VERSION_NUMBER)
+#if (defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3) || defined(LIBRESSL_VERSION_NUMBER)
         rb_raise(rb_eNotImpError, "calling #mul with arrays is not" \
                  "supported by this OpenSSL version");
 #else
-- 
cgit v1.1


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

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