From f20f7041cf4bd2847e1f82d52a0505a9c72f1624 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Thu, 18 Sep 2025 08:24:13 +0900 Subject: [PATCH] Fix compiling issue on 32-bit environments. It is reported that compiling src/parser/snprintf.c on 32-bit environments fails due to undefined functions (isnan() and ininf()). They come from math.h so include it. snprintf.c was imported from PostgreSQL long time ago. If we look into the original file (src/port/snprintf.c) it actually has "#include " already. Including math.h was provided as a pull request: https://github.com/pgpool/pgpool2/pull/128 I also added a minor modification to the patch to reorder the positions of include files. Author: Gyorgy Sarvari Discussion: https://www.postgresql.org/message-id/20250917.194736.353755422175293639.ishii%40postgresql.org Backpatch-through: v4.2 --- src/parser/snprintf.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/parser/snprintf.c b/src/parser/snprintf.c index 19e666b7c..43059ace6 100644 --- a/src/parser/snprintf.c +++ b/src/parser/snprintf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2024, PgPool Global Development Group + * Copyright (c) 2003-2025, PgPool Global Development Group * Copyright (c) 1983, 1995, 1996 Eric P. Allman * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -32,17 +32,14 @@ * src/port/snprintf.c */ -#if 0 -#include "c.h" -#endif - +#include +#include +#include #include -#include #include +#include #include #include -#include -#include #include "pool_parser.h" #include "stringinfo.h" #include "utils/palloc.h" -- 2.39.5