mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
0b55f8a14f
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); | ^~~~~~~ ```
27 lines
654 B
Ruby
27 lines
654 B
Ruby
# frozen_string_literal: true
|
|
module OpenSSL
|
|
def self.deprecated_warning_flag
|
|
unless flag = (@deprecated_warning_flag ||= nil)
|
|
if try_compile("", flag = "-Werror=deprecated-declarations")
|
|
$warnflags << " #{flag}"
|
|
else
|
|
flag = ""
|
|
end
|
|
@deprecated_warning_flag = flag
|
|
end
|
|
flag
|
|
end
|
|
|
|
def self.restore_warning_flag
|
|
$warnflags = @warnflags
|
|
end
|
|
|
|
def self.check_func(func, header)
|
|
have_func(func, header, deprecated_warning_flag)
|
|
end
|
|
|
|
def self.check_func_or_macro(func, header)
|
|
check_func(func, header) or
|
|
have_macro(func, header) && $defs.push("-DHAVE_#{func.upcase}")
|
|
end
|
|
end
|