0001-Fix-header-inclusion-order-in-c.h.patch

text/x-patch

Filename: 0001-Fix-header-inclusion-order-in-c.h.patch
Type: text/x-patch
Part: 0
Message: Re: Cannot find a working 64-bit integer type on Illumos

Patch

Format: format-patch
Series: patch 0001
Subject: Fix header inclusion order in c.h.
File+
src/include/c.h 1 2
From 36e93b7c51dbc8a8d5a9b857a3616edb18c914a6 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Thu, 5 Dec 2024 11:06:28 +1300
Subject: [PATCH 1/2] Fix header inclusion order in c.h.

Commit 962da900a added #include <stdint.h> to postgres_ext.h, which
broke c.h's header ordering rule.

The system headers on some systems would then lock down off_t's size in
other private macros, before they'd had a chance to see our definition
of _FILE_OFFSET_BITS (and perhaps did the same for other things).  This
was picked up by perl's ABI compatibility checks on some 32 bit systems
in the build farm.

Move #include "postgres_ext.h" below that, because there isn't any
current reason for the original ordering.

Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/2397643.1733347237%40sss.pgh.pa.us
---
 src/include/c.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/include/c.h b/src/include/c.h
index 734626e75a8..1271137f5df 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -46,11 +46,10 @@
 #ifndef C_H
 #define C_H
 
-#include "postgres_ext.h"
-
 #include "pg_config.h"
 #include "pg_config_manual.h"	/* must be after pg_config.h */
 #include "pg_config_os.h"		/* must be before any system header files */
+#include "postgres_ext.h"		/* includes a system header file */
 
 /* System header files that should be available everywhere in Postgres */
 #include <inttypes.h>
-- 
2.47.0