Skip to content

Commit 1fe8944

Browse files
Merge pull request #6545 from bigbrett/serverListening-include-guard
fix pthread macro protection in tls_bench
2 parents 20115f0 + 9bed65a commit 1fe8944

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

examples/benchmark/tls_bench.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Or
7878
#undef HAVE_PTHREAD
7979
#endif
8080
#endif
81+
/* Conversely, if both server and client are enabled, we must require pthreads */
82+
#if !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
83+
&& !defined(HAVE_PTHREAD)
84+
#error "pthreads must be enabled if building benchmark suite \
85+
to run both client and server. Please define HAVE_PTHREAD if your \
86+
platform supports it"
87+
#endif
8188

8289
#ifdef HAVE_PTHREAD
8390
#include <pthread.h>
@@ -2103,7 +2110,7 @@ int bench_tls(void* args)
21032110
#endif
21042111
#endif
21052112
if (argClientOnly) {
2106-
#if !defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT)
2113+
#if !defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT) && defined(HAVE_PTHREAD)
21072114
/* to avoid to wait server forever */
21082115
info->serverListening = 1;
21092116
#endif

0 commit comments

Comments
 (0)