From d5908ff15d552de5e0ddf685dae1b1046bb362b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 20 Aug 2025 13:42:56 +0200 Subject: [PATCH] lib/utils.h: avoid issues with inclusion in C++ --- lib/utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils.h b/lib/utils.h index 4e83a985a..5ca6fd08f 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -633,6 +633,7 @@ static inline const knot_dname_t * knot_dname_next_label(const knot_dname_t *dn } #endif +#ifndef __cplusplus /* The atomic stuff seems more trouble than worth on C++ includes. */ /* Determine whether to perform an action (logging) limited once per time period in ms. */ static inline bool kr_log_period(uint32_t period, _Atomic uint32_t *last_time) { const uint32_t time_now = kr_now(); // 32 bits are sufficient here @@ -647,6 +648,7 @@ static inline bool kr_log_period(uint32_t period, _Atomic uint32_t *last_time) { } return false; } +#endif /* Initialize last_time for kr_log_period. */ static inline uint32_t kr_log_period_init(uint32_t period) { -- 2.47.2