define WLOG to a no-op when not used with debugging

pull/839/head
JacobBarthelmeh 2025-10-07 10:08:10 -06:00
parent 967d6c59ff
commit 92cb91664d
2 changed files with 6 additions and 2 deletions

View File

@ -11367,6 +11367,7 @@ int wolfSSH_RsaVerify(const byte *sig, word32 sigSz,
#endif
if (checkSig)
WFREE(checkSig, heap, DYNTYPE_TEMP);
WOLFSSH_UNUSED(loc); /* Unused when WLOG is not defined */
return ret;
}
#endif /* WOLFSSH_NO_RSA */

View File

@ -72,11 +72,14 @@ WOLFSSH_API int wolfSSH_LogEnabled(void);
WOLFSSH_API void wolfSSH_Log(enum wolfSSH_LogLevel,
const char *const, ...) FMTCHECK;
#define WLOG(...) do { \
#if defined(DEBUG_WOLFSSH) || defined(WOLFSSH_SSHD)
#define WLOG(...) do { \
if (wolfSSH_LogEnabled()) \
wolfSSH_Log(__VA_ARGS__); \
} while (0)
#else
#define WLOG(...) WC_DO_NOTHING
#endif
#ifdef __cplusplus
}