Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't include stdio.h if not needed. #7908

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ typedef struct w64wrapper {
#ifdef WOLFSSL_NO_MALLOC
/* this platform does not support heap use */
#ifdef WOLFSSL_MALLOC_CHECK
#ifndef NO_STDIO_FILESYSTEM
#include <stdio.h>
#endif
static inline void* malloc_check(size_t sz) {
fprintf(stderr, "wolfSSL_malloc failed");
return NULL;
Expand Down Expand Up @@ -842,12 +844,16 @@ typedef struct w64wrapper {
have stdio.h available, so it needs its own section. */
#define XSNPRINTF snprintf
#elif defined(WOLF_C89)
#ifndef NO_STDIO_FILESYSTEM
#include <stdio.h>
#endif
#define XSPRINTF sprintf
/* snprintf not available for C89, so remap using macro */
#define XSNPRINTF(f, len, ...) sprintf(f, __VA_ARGS__)
#else
#ifndef NO_STDIO_FILESYSTEM
#include <stdio.h>
#endif
#define XSNPRINTF snprintf
#endif
#else
Expand Down