Skip to content

Commit

Permalink
Merge pull request #6545 from bigbrett/serverListening-include-guard
Browse files Browse the repository at this point in the history
fix pthread macro protection in tls_bench
  • Loading branch information
JacobBarthelmeh authored Jul 14, 2023
2 parents 20115f0 + 9bed65a commit 1fe8944
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/benchmark/tls_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Or
#undef HAVE_PTHREAD
#endif
#endif
/* Conversely, if both server and client are enabled, we must require pthreads */
#if !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
&& !defined(HAVE_PTHREAD)
#error "pthreads must be enabled if building benchmark suite \
to run both client and server. Please define HAVE_PTHREAD if your \
platform supports it"
#endif

#ifdef HAVE_PTHREAD
#include <pthread.h>
Expand Down Expand Up @@ -2103,7 +2110,7 @@ int bench_tls(void* args)
#endif
#endif
if (argClientOnly) {
#if !defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT)
#if !defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT) && defined(HAVE_PTHREAD)
/* to avoid to wait server forever */
info->serverListening = 1;
#endif
Expand Down

0 comments on commit 1fe8944

Please sign in to comment.