Renamed error_strerror() to the less conflicting polarssl_strerror()

Ability to keep old function error_strerror() as well with
POLARSSL_ERROR_STRERROR_BC. Also works with
POLARSSL_ERROR_STRERROR_DUMMY.
This commit is contained in:
Paul Bakker 2013-06-29 18:24:32 +02:00
parent 89fe7f4388
commit e2ab84f4a1
5 changed files with 49 additions and 4 deletions

View file

@ -37,7 +37,7 @@ HEADER_INCLUDED
#define snprintf _snprintf
#endif
void error_strerror( int ret, char *buf, size_t buflen )
void polarssl_strerror( int ret, char *buf, size_t buflen )
{
size_t len;
int use_ret;
@ -88,6 +88,13 @@ LOW_LEVEL_CODE_CHECKS
snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
}
#if defined(POLARSSL_ERROR_STRERROR_BC)
void error_strerror( int ret, char *buf, size_t buflen )
{
return polarssl_strerror( ret, buf, buflen );
}
#endif /* POLARSSL_ERROR_STRERROR_BC */
#else /* POLARSSL_ERROR_C */
#if defined(POLARSSL_ERROR_STRERROR_DUMMY)
@ -97,7 +104,7 @@ LOW_LEVEL_CODE_CHECKS
/*
* Provide an non-function in case POLARSSL_ERROR_C is not defined
*/
void error_strerror( int ret, char *buf, size_t buflen )
void polarssl_strerror( int ret, char *buf, size_t buflen )
{
((void) ret);
@ -105,5 +112,12 @@ void error_strerror( int ret, char *buf, size_t buflen )
buf[0] = '\0';
}
#if defined(POLARSSL_ERROR_STRERROR_BC)
void error_strerror( int ret, char *buf, size_t buflen )
{
return polarssl_strerror( ret, buf, buflen );
}
#endif /* POLARSSL_ERROR_STRERROR_BC */
#endif /* POLARSSL_ERROR_STRERROR_DUMMY */
#endif /* POLARSSL_ERROR_C */