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()
This commit is contained in:
parent
14c56a3378
commit
8fe40dcd7d
4 changed files with 35 additions and 2 deletions
|
@ -553,4 +553,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…
Add table
Add a link
Reference in a new issue