diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-11 21:37:18 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-11 21:42:07 +0300 |
| commit | 1c69485e1ebd17bf3cc6e8fc4728f9bdb431de94 (patch) | |
| tree | fa86681a712ff3c0605c96883c000d864cb60b53 /accel-pppd/logs/log_pgsql.c | |
| parent | 86e71f2aa48d62e1c63253f0986d5f643410a263 (diff) | |
| download | accel-ppp-1c69485e1ebd17bf3cc6e8fc4728f9bdb431de94.tar.gz accel-ppp-1c69485e1ebd17bf3cc6e8fc4728f9bdb431de94.zip | |
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 <sys/param.h> 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.
Diffstat (limited to 'accel-pppd/logs/log_pgsql.c')
| -rw-r--r-- | accel-pppd/logs/log_pgsql.c | 3 |
1 files changed, 1 insertions, 2 deletions
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; |
