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 <pthread.h>
                 ^~~~~~~~~~~
    compilation terminated.

Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
This commit is contained in:
Titouan Christophe 2020-08-18 01:26:58 +02:00 committed by Roger Light
parent 2fdb5a0171
commit 79051fbdca

View File

@ -20,11 +20,13 @@ Contributors:
#include <time.h>
#endif
#if defined(WITH_THREADING)
#if defined(__linux__) || defined(__NetBSD__)
# include <pthread.h>
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
# include <pthread_np.h>
#endif
#endif
#include "mosquitto_internal.h"
#include "net_mosq.h"