From: Vladimír Čunát Date: Wed, 20 Aug 2025 11:42:56 +0000 (+0200) Subject: lib/utils.h: avoid issues with inclusion in C++ X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fenvironments%2Fdocs-defer-hard-t-wlwi0n%2Fdeployments%2F7441;p=thirdparty%2Fknot-resolver.git lib/utils.h: avoid issues with inclusion in C++ --- 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) {