Skip to content

Commit db1955b

Browse files
committed
Fixed build when MBEDTLS_DEBUG_C is turned off
MBEDTLS_DEBUG_C is a flag that can be disabled in mbedtls/config.h, to disable mbedTLS's debug logging. I tried doing so, which revealed two compile errors in mbdetls_context.cpp. This fixes them.
1 parent ffde73a commit db1955b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mbedtls_context.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ namespace sockpp {
108108

109109
public:
110110

111+
#ifdef MBEDTLS_DEBUG_C
111112
#define log(LEVEL, FMT,...) do { \
112113
auto ssl = &ssl_; \
113114
MBEDTLS_SSL_DEBUG_MSG(LEVEL, ("SockPP: " FMT, ## __VA_ARGS__)); \
114115
}while(0)
116+
#else
117+
#define log(LEVEL, FMT,...) do { } while(0)
118+
#endif
115119

116120

117121
int log_mbed_ret(int ret, const char *fn) {
@@ -628,7 +632,9 @@ namespace sockpp {
628632
}, this);
629633
}
630634
logger_ = logger;
635+
#ifdef MBEDTLS_DEBUG_C
631636
mbedtls_debug_set_threshold(threshold);
637+
#endif
632638
}
633639

634640

0 commit comments

Comments
 (0)