]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/utils.h: avoid issues with inclusion in C++ docs-defer-hard-t-wlwi0n/deployments/7441
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 20 Aug 2025 11:42:56 +0000 (13:42 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 20 Aug 2025 11:44:26 +0000 (13:44 +0200)
lib/utils.h

index 4e83a985a474e7ef2ec957e1b380fa5a2b30d1bf..5ca6fd08fd62b485c25ce6666d97ed556b33ad85 100644 (file)
@@ -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) {