From 0b55f8a14f28b070177ee0ddcd76edb46af9a395 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 16 Feb 2020 19:14:23 +0900 Subject: ext/openssl/extconf.rb: avoid -Werror=deprecated-declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails to build on Solaris: https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200216T090008Z.log.html.gz ``` ossl_cipher.c: 関数 ‘ossl_cipher_init’ 内: ossl_cipher.c:228:2: エラー: ‘EVP_md5’ is deprecated [-Werror=deprecated-declarations] 228 | EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), EVP_md5(), iv, | ^~~~~~~~~~~~~~ In file included from /usr/include/openssl/x509.h:73, from /usr/include/openssl/x509v3.h:63, from ossl.h:23, from ossl_cipher.c:10: /usr/include/openssl/evp.h:732:26: 備考: ここで宣言されています 732 | DEPRECATED const EVP_MD *EVP_md5(void); | ^~~~~~~ ``` --- ext/openssl/deprecation.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/openssl/deprecation.rb') diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb index 6af7d562fb..fdf2d30ed0 100644 --- a/ext/openssl/deprecation.rb +++ b/ext/openssl/deprecation.rb @@ -12,6 +12,10 @@ module OpenSSL flag end + def self.restore_warning_flag + $warnflags = @warnflags + end + def self.check_func(func, header) have_func(func, header, deprecated_warning_flag) end -- cgit v1.2.3