File 0372-crypto-Fix-compile-error-for-early-LibreSSL.patch of Package erlang
From 1af5e8f0219c0a4a31eda7218758658283e31108 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Mon, 20 Sep 2021 08:36:44 +0200
Subject: [PATCH] crypto: Fix compile error for early LibreSSL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There was a warning (treated as error) in the OTP/crypto if compiled with LibreSSL 2.1.5:
error: implicit declaration of function ‘OpenSSL_version_num’ [-Werror=implicit-function-declaration]
It is also present in other early LibreSSL.
---
lib/crypto/c_src/crypto.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index a79bd12fca..977b4e4c8b 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -131,7 +131,8 @@ ERL_NIF_INIT(crypto,nif_funcs,load,NULL,upgrade,unload)
static int verify_lib_version(void)
{
-#if OPENSSL_VERSION_NUMBER < PACKED_OPENSSL_VERSION_PLAIN(1,1,0)
+#if OPENSSL_VERSION_NUMBER < PACKED_OPENSSL_VERSION_PLAIN(1,1,0) \
+ || defined(HAS_LIBRESSL)
const unsigned long libv = SSLeay();
#else
const unsigned long libv = OpenSSL_version_num();
--
2.31.1