forked from wolfSSL/wolfssl
Added support for printf override using XPRINTF for wolfCrypt test/benchmark. Added ability to override snprintf with XSNPRINTF. If STRING_USER
is defined no standard lib <string.h>
or <stdio.h>
will be included.
This commit is contained in:
@ -113,8 +113,16 @@
|
||||
#include <stdlib.h> /* we're using malloc / free direct here */
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#ifndef STRING_USER
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
/* enable way for customer to override test/bench printf */
|
||||
#ifdef XPRINTF
|
||||
#undef printf
|
||||
#define printf XPRINTF
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/memory.h>
|
||||
|
@ -105,8 +105,15 @@
|
||||
#ifdef XMALLOC_USER
|
||||
#include <stdlib.h> /* we're using malloc / free direct here */
|
||||
#endif
|
||||
#ifndef STRING_USER
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
/* enable way for customer to override test/bench printf */
|
||||
#ifdef XPRINTF
|
||||
#undef printf
|
||||
#define printf XPRINTF
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/memory.h>
|
||||
|
@ -29,7 +29,9 @@
|
||||
#ifndef WOLFSSL_MEMORY_H
|
||||
#define WOLFSSL_MEMORY_H
|
||||
|
||||
#ifndef STRING_USER
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -430,6 +430,7 @@
|
||||
/* snprintf is used in asn.c for GetTimeString, PKCS7 test, and when
|
||||
debugging is turned on */
|
||||
#ifndef USE_WINDOWS_API
|
||||
#ifndef XSNPRINTF
|
||||
#if defined(NO_FILESYSTEM) && (defined(OPENSSL_EXTRA) || \
|
||||
defined(HAVE_PKCS7)) && !defined(NO_STDIO_FILESYSTEM)
|
||||
/* case where stdio is not included else where but is needed
|
||||
@ -437,6 +438,7 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#define XSNPRINTF snprintf
|
||||
#endif
|
||||
#else
|
||||
#ifdef _MSC_VER
|
||||
#if (_MSC_VER >= 1900)
|
||||
|
Reference in New Issue
Block a user