mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 06:01:11 +00:00
Allow enabling of dummy error_strerror() to support some use-cases
Enable a dummy error function to make use of error_strerror() in
third party libraries easier.
Disable if you run into name conflicts and want to really remove the
error_strerror()
(cherry picked from commit 8fe40dcd7d
)
Conflicts:
ChangeLog
programs/util/strerror.c
This commit is contained in:
parent
66a531b014
commit
cb60e7c065
|
@ -1,5 +1,9 @@
|
|||
PolarSSL ChangeLog
|
||||
|
||||
= Branch 1.1
|
||||
Changes
|
||||
* Allow enabling of dummy error_strerror() to support some use-cases
|
||||
|
||||
= Version 1.1.5 released on 2013-01-16
|
||||
Bugfix
|
||||
* Fixed MPI assembly for SPARC64 platform
|
||||
|
|
|
@ -138,6 +138,17 @@
|
|||
*/
|
||||
#define POLARSSL_DEBUG_MSG
|
||||
|
||||
/**
|
||||
* \def POLARSSL_ERROR_STRERROR_DUMMY
|
||||
*
|
||||
* Enable a dummy error function to make use of error_strerror() in
|
||||
* third party libraries easier.
|
||||
*
|
||||
* Disable if you run into name conflicts and want to really remove the
|
||||
* error_strerror()
|
||||
*/
|
||||
#define POLARSSL_ERROR_STRERROR_DUMMY
|
||||
|
||||
/**
|
||||
* \def POLARSSL_GENPRIME
|
||||
*
|
||||
|
|
|
@ -509,4 +509,22 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
|||
snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
|
||||
}
|
||||
|
||||
#else /* POLARSSL_ERROR_C */
|
||||
|
||||
#if defined(POLARSSL_ERROR_STRERROR_DUMMY)
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Provide an non-function in case POLARSSL_ERROR_C is not defined
|
||||
*/
|
||||
void error_strerror( int ret, char *buf, size_t buflen )
|
||||
{
|
||||
((void) ret);
|
||||
|
||||
if( buflen > 0 )
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
#endif /* POLARSSL_ERROR_STRERROR_DUMMY */
|
||||
#endif /* POLARSSL_ERROR_C */
|
||||
|
|
Loading…
Reference in a new issue