diff options
Diffstat (limited to 'contrib/ntp/include/ssl_applink.c')
-rw-r--r-- | contrib/ntp/include/ssl_applink.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/contrib/ntp/include/ssl_applink.c b/contrib/ntp/include/ssl_applink.c index ba1f4a8..e57cabd 100644 --- a/contrib/ntp/include/ssl_applink.c +++ b/contrib/ntp/include/ssl_applink.c @@ -10,8 +10,13 @@ # ifdef _MSC_VER # pragma warning(push) # pragma warning(disable: 4152) +# ifndef OPENSSL_NO_AUTOLINK +# include "msvc_ssl_autolib.h" +# endif +# endif +# if OPENSSL_VERSION_NUMBER < 0x10100000L +# include <openssl/applink.c> # endif -# include <openssl/applink.c> # ifdef _MSC_VER # pragma warning(pop) # endif @@ -25,20 +30,30 @@ void *wrap_dbg_malloc(size_t s, const char *f, int l); void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l); void wrap_dbg_free(void *p); +void wrap_dbg_free_ex(void *p, const char *f, int l); #endif #if defined(OPENSSL) && defined(SYS_WINNT) + void ssl_applink(void); void ssl_applink(void) { -#ifdef WRAP_DBG_MALLOC - CRYPTO_set_mem_ex_functions(wrap_dbg_malloc, wrap_dbg_realloc, wrap_dbg_free); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L +# ifdef WRAP_DBG_MALLOC + CRYPTO_set_mem_functions(wrap_dbg_malloc, wrap_dbg_realloc, wrap_dbg_free_ex); +# else + OPENSSL_malloc_init(); +# endif #else +# ifdef WRAP_DBG_MALLOC + CRYPTO_set_mem_ex_functions(wrap_dbg_malloc, wrap_dbg_realloc, wrap_dbg_free); +# else CRYPTO_malloc_init(); -#endif +# endif +#endif /* OpenSSL version cascade */ } #else /* !OPENSSL || !SYS_WINNT */ #define ssl_applink() do {} while (0) @@ -71,4 +86,11 @@ void wrap_dbg_free(void *p) { _free_dbg(p, _NORMAL_BLOCK); } + +void wrap_dbg_free_ex(void *p, const char *f, int l) +{ + (void)f; + (void)l; + _free_dbg(p, _NORMAL_BLOCK); +} #endif /* WRAP_DBG_MALLOC */ |