mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Use platform layer in programs for consistency.
This commit is contained in:
parent
e94e6e5b9c
commit
f90016aade
48 changed files with 1572 additions and 1145 deletions
|
|
@ -26,6 +26,15 @@
|
|||
#include POLARSSL_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_printf printf
|
||||
#define polarssl_fprintf fprintf
|
||||
#define polarssl_malloc malloc
|
||||
#define polarssl_free free
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -72,7 +81,7 @@ int main( int argc, char *argv[] )
|
|||
else
|
||||
{
|
||||
v = 1;
|
||||
printf( "\n" );
|
||||
polarssl_printf( "\n" );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_SELF_TEST)
|
||||
|
|
@ -215,7 +224,7 @@ int main( int argc, char *argv[] )
|
|||
#endif
|
||||
|
||||
#else
|
||||
printf( " POLARSSL_SELF_TEST not defined.\n" );
|
||||
polarssl_printf( " POLARSSL_SELF_TEST not defined.\n" );
|
||||
#endif
|
||||
|
||||
if( v != 0 )
|
||||
|
|
@ -234,9 +243,9 @@ int main( int argc, char *argv[] )
|
|||
|
||||
if( v != 0 )
|
||||
{
|
||||
printf( " [ All tests passed ]\n\n" );
|
||||
polarssl_printf( " [ All tests passed ]\n\n" );
|
||||
#if defined(_WIN32)
|
||||
printf( " Press Enter to exit this program.\n" );
|
||||
polarssl_printf( " Press Enter to exit this program.\n" );
|
||||
fflush( stdout ); getchar();
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue