Skip to content

Commit 8a02312

Browse files
define WLOG to a no-op when not used with debugging
1 parent 50aa10d commit 8a02312

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/internal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11343,6 +11343,7 @@ int wolfSSH_RsaVerify(const byte *sig, word32 sigSz,
1134311343
#endif
1134411344
if (checkSig)
1134511345
WFREE(checkSig, heap, DYNTYPE_TEMP);
11346+
WOLFSSH_UNUSED(loc); /* Unused when WLOG is not defined */
1134611347
return ret;
1134711348
}
1134811349
#endif /* WOLFSSH_NO_RSA */

wolfssh/log.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ WOLFSSH_API int wolfSSH_LogEnabled(void);
7272
WOLFSSH_API void wolfSSH_Log(enum wolfSSH_LogLevel,
7373
const char *const, ...) FMTCHECK;
7474

75-
#define WLOG(...) do { \
75+
#if defined(DEBUG_WOLFSSH) || defined(WOLFSSH_SSHD)
76+
#define WLOG(...) do { \
7677
if (wolfSSH_LogEnabled()) \
7778
wolfSSH_Log(__VA_ARGS__); \
7879
} while (0)
79-
80+
#else
81+
#define WLOG(...) WC_DO_NOTHING
82+
#endif
8083

8184
#ifdef __cplusplus
8285
}

0 commit comments

Comments
 (0)