From 1c69485e1ebd17bf3cc6e8fc4728f9bdb431de94 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Tue, 11 Aug 2026 21:37:18 +0300 Subject: utils: centralize min macro Several userspace translation units carry identical local min() definitions. Move the guarded definition to utils.h and include it from each user so there is one implementation to maintain. The Linux min() macro lives in kernel-internal headers and is not part of the userspace UAPI. Clang/LLVM does not provide a compatible min macro either: C++ code uses std::min and Clang's similarly named operations use explicit builtin names. The userspace interface, where available, exposes uppercase MIN instead. Keep the #ifndef guard to preserve the behavior of the existing local definitions and avoid redefining a lowercase min macro supplied by an unrelated third-party header. --- accel-pppd/logs/log_pgsql.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'accel-pppd/logs/log_pgsql.c') diff --git a/accel-pppd/logs/log_pgsql.c b/accel-pppd/logs/log_pgsql.c index 99be5e64..5b3fd6ae 100644 --- a/accel-pppd/logs/log_pgsql.c +++ b/accel-pppd/logs/log_pgsql.c @@ -9,11 +9,10 @@ #include "log.h" #include "list.h" #include "ap_session.h" +#include "utils.h" #include "memdebug.h" -#define min(x,y) ((x)<(y)?(x):(y)) - static char *conf_conninfo; static int conf_queue_max = 1000; static char *conf_query; -- cgit v1.2.3