Skip to content

Commit 92cb916

Browse files
define WLOG to a no-op when not used with debugging
1 parent 967d6c5 commit 92cb916

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/internal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11367,6 +11367,7 @@ int wolfSSH_RsaVerify(const byte *sig, word32 sigSz,
1136711367
#endif
1136811368
if (checkSig)
1136911369
WFREE(checkSig, heap, DYNTYPE_TEMP);
11370+
WOLFSSH_UNUSED(loc); /* Unused when WLOG is not defined */
1137011371
return ret;
1137111372
}
1137211373
#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)