Merge pull request #768 from signalwire/osx-build

[core] fix build with newer build tools against openssl 1.1
This commit is contained in:
Andrey Volk 2020-08-03 23:52:18 +04:00 committed by GitHub
commit e9bba9e149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,8 @@ static switch_mutex_t **ssl_mutexes;
static switch_memory_pool_t *ssl_pool = NULL;
static int ssl_count = 0;
#if OPENSSL_VERSION_NUMBER <= 0x10100000
static inline void switch_ssl_ssl_lock_callback(int mode, int type, char *file, int line)
{
if (mode & CRYPTO_LOCK) {
@ -51,6 +53,8 @@ static inline void switch_ssl_ssl_thread_id(CRYPTO_THREADID *id)
CRYPTO_THREADID_set_numeric(id, (unsigned long)switch_thread_self());
}
#endif
SWITCH_DECLARE(void) switch_ssl_init_ssl_locks(void)
{
@ -69,8 +73,10 @@ SWITCH_DECLARE(void) switch_ssl_init_ssl_locks(void)
switch_assert(ssl_mutexes[i] != NULL);
}
#if OPENSSL_VERSION_NUMBER <= 0x10100000
CRYPTO_THREADID_set_callback(switch_ssl_ssl_thread_id);
CRYPTO_set_locking_callback((void (*)(int, int, const char*, int))switch_ssl_ssl_lock_callback);
#endif
}
ssl_count++;