From 44faddac6c65a9db79dc2838d24ca5726aba88d5 Mon Sep 17 00:00:00 2001 From: Brett Nicholas Date: Mon, 26 Jun 2023 10:08:24 -0600 Subject: [PATCH 1/3] fix compiler error for targets that don't define HAVE_PTHREAD --- examples/benchmark/tls_bench.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/benchmark/tls_bench.c b/examples/benchmark/tls_bench.c index ba41a59fb..821423950 100644 --- a/examples/benchmark/tls_bench.c +++ b/examples/benchmark/tls_bench.c @@ -2103,7 +2103,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 From b02a22b5b35ad0278c4f8fe87555fa398aace4ae Mon Sep 17 00:00:00 2001 From: Brett Nicholas Date: Mon, 26 Jun 2023 13:27:55 -0600 Subject: [PATCH 2/3] added error reporting macro for invalid configuration --- examples/benchmark/tls_bench.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/benchmark/tls_bench.c b/examples/benchmark/tls_bench.c index 821423950..a062c18d7 100644 --- a/examples/benchmark/tls_bench.c +++ b/examples/benchmark/tls_bench.c @@ -78,6 +78,10 @@ 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 From 9bed65ad57ff562b5a04b5cfade1d61a0483eed1 Mon Sep 17 00:00:00 2001 From: Brett Nicholas Date: Wed, 28 Jun 2023 10:26:08 -0600 Subject: [PATCH 3/3] split up error message split #if into multiple lines --- examples/benchmark/tls_bench.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/benchmark/tls_bench.c b/examples/benchmark/tls_bench.c index a062c18d7..ef89c8bae 100644 --- a/examples/benchmark/tls_bench.c +++ b/examples/benchmark/tls_bench.c @@ -79,8 +79,11 @@ Or #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." +#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