From 32abd87cc7475b05310f6cca9f9b6cce48a8ec6d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 6 Mar 2026 13:51:02 +1000 Subject: [PATCH] util: ifndef the etrace and trace macros This macros are incredibly useful to use globally so let's ifdef them out in case developers have them sitting around in global headers. Part-of: --- src/util-macros.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util-macros.h b/src/util-macros.h index 369ca58..3b11b38 100644 --- a/src/util-macros.h +++ b/src/util-macros.h @@ -71,6 +71,7 @@ static int _once_per_##__func__ = 0; \ for (; _once_per_##__func__ == 0; _once_per_##__func__ = 1) +#if !defined(trace) && !defined(etrace) #define trace(...) \ do { \ char buf_[1024]; \ @@ -84,3 +85,4 @@ snprintf(buf_, sizeof(buf_), __VA_ARGS__); \ fprintf(stderr, "\x1B[0;34m" "%s():%d - " "\x1B[0;31m" "%s" "\x1B[0m" "\n", __func__, __LINE__, buf_); \ } while (0) +#endif