diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-07-28 11:16:41 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-07-28 11:16:58 +0200 |
commit | d8e1cd7a109bc832826f21d6df1faf401be8dcc9 (patch) | |
tree | bfbce3426cb677827d6086a3e135aa4110af0fbf /thirdparty/mbedtls/library/platform.c | |
parent | 4e4702e3868af342b0e2964c7753fa4a3aa83af8 (diff) |
mbedtls: Update to upstream version 2.12.0
_WIN32_WINNT redefinition fix is no longer needed as it was merged
upstream. PR 1453 is still not merged, diff updated to current state.
Diffstat (limited to 'thirdparty/mbedtls/library/platform.c')
-rw-r--r-- | thirdparty/mbedtls/library/platform.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/thirdparty/mbedtls/library/platform.c b/thirdparty/mbedtls/library/platform.c index 9e992875d9..b24b2fa652 100644 --- a/thirdparty/mbedtls/library/platform.c +++ b/thirdparty/mbedtls/library/platform.c @@ -51,14 +51,24 @@ static void platform_free_uninit( void *ptr ) #define MBEDTLS_PLATFORM_STD_FREE platform_free_uninit #endif /* !MBEDTLS_PLATFORM_STD_FREE */ -void * (*mbedtls_calloc)( size_t, size_t ) = MBEDTLS_PLATFORM_STD_CALLOC; -void (*mbedtls_free)( void * ) = MBEDTLS_PLATFORM_STD_FREE; +static void * (*mbedtls_calloc_func)( size_t, size_t ) = MBEDTLS_PLATFORM_STD_CALLOC; +static void (*mbedtls_free_func)( void * ) = MBEDTLS_PLATFORM_STD_FREE; + +void * mbedtls_calloc( size_t nmemb, size_t size ) +{ + return (*mbedtls_calloc_func)( nmemb, size ); +} + +void mbedtls_free( void * ptr ) +{ + (*mbedtls_free_func)( ptr ); +} int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ), void (*free_func)( void * ) ) { - mbedtls_calloc = calloc_func; - mbedtls_free = free_func; + mbedtls_calloc_func = calloc_func; + mbedtls_free_func = free_func; return( 0 ); } #endif /* MBEDTLS_PLATFORM_MEMORY */ |