From 920429fe3db975c22d2b6eff2bf2061126bb4bfc Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sat, 3 Feb 2024 04:46:58 +0100 Subject: Completly disable all pthread related code in the library if `USE_GLOBAL_CONTEXT` macro is not defined. Signed-off-by: Toni Uhlig --- src/include/ndpi_typedefs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/include') diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index ebad711f1..11a8e05a2 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -25,9 +25,12 @@ E * ndpi_typedefs.h #define __NDPI_TYPEDEFS_H__ #ifndef NDPI_CFFI_PREPROCESSING +#include "ndpi_config.h" +#ifdef USE_GLOBAL_CONTEXT #define HAVE_STRUCT_TIMESPEC #include #endif +#endif #include "ndpi_define.h" #ifndef NDPI_CFFI_PREPROCESSING @@ -769,7 +772,9 @@ struct ndpi_lru_cache { u_int32_t num_entries; u_int32_t ttl : 31, shared : 1; #ifndef NDPI_CFFI_PREPROCESSING +#ifdef USE_GLOBAL_CONTEXT pthread_mutex_t mutex; +#endif #endif struct ndpi_lru_cache_stats stats; struct ndpi_lru_cache_entry *entries; -- cgit v1.2.3