From 79051fbdca3a137d5ef000bec3edfe93eaa4c224 Mon Sep 17 00:00:00 2001 From: Titouan Christophe Date: Tue, 18 Aug 2020 01:26:58 +0200 Subject: [PATCH] do not include pthread when compiling without threading support This fixes the following error, when compiling for systems without pthread support, and when passing WITH_THREADING=no to make: thread_mosq.c:24:12: fatal error: pthread.h: No such file or directory # include ^~~~~~~~~~~ compilation terminated. Signed-off-by: Titouan Christophe --- lib/thread_mosq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/thread_mosq.c b/lib/thread_mosq.c index b05c1d2a..46e19807 100644 --- a/lib/thread_mosq.c +++ b/lib/thread_mosq.c @@ -20,11 +20,13 @@ Contributors: #include #endif +#if defined(WITH_THREADING) #if defined(__linux__) || defined(__NetBSD__) # include #elif defined(__FreeBSD__) || defined(__OpenBSD__) # include #endif +#endif #include "mosquitto_internal.h" #include "net_mosq.h"