summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-04-29 15:02:19 +0200
committerBenoit Daloze <eregontp@gmail.com>2021-05-04 14:56:55 +0200
commit59a92a84c8145c3dffd9f2a0e570dbc61211c86c (patch)
treef4bb4b5d04257c84ebcf292b662605f07c6c9ae3
parentf1dcc3da5d89b0a03cbc280e7eafb845d63a1f6a (diff)
Fix -Wundef warnings in core extensions
* See [Feature #17752]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4428
-rw-r--r--ext/nkf/nkf-utf8/nkf.h4
-rw-r--r--ext/openssl/ossl_pkey_ec.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/nkf/nkf-utf8/nkf.h b/ext/nkf/nkf-utf8/nkf.h
index cd3037601b..b3a520da54 100644
--- a/ext/nkf/nkf-utf8/nkf.h
+++ b/ext/nkf/nkf-utf8/nkf.h
@@ -16,8 +16,8 @@
#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 deca4f43b0..be9b09cae6 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)
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