Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 71cb352

Browse files
committed
Fix header inclusion order in c.h.
Commit 962da90 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 private macros, before they'd had a chance to see our definition of _FILE_OFFSET_BITS (and presumably 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" down below the system header section, and make the comments clearer (thanks to Tom for the new wording). Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/2397643.1733347237%40sss.pgh.pa.us
1 parent 76fd342 commit 71cb352

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/include/c.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@
4646
#ifndef C_H
4747
#define C_H
4848

49-
#include "postgres_ext.h"
50-
49+
/*
50+
* These headers must be included before any system headers, because on some
51+
* platforms they affect the behavior of the system headers (for example, by
52+
* defining _FILE_OFFSET_BITS).
53+
*/
5154
#include "pg_config.h"
5255
#include "pg_config_manual.h" /* must be after pg_config.h */
53-
#include "pg_config_os.h" /* must be before any system header files */
56+
#include "pg_config_os.h" /* config from include/port/PORTNAME.h */
5457

5558
/* System header files that should be available everywhere in Postgres */
5659
#include <inttypes.h>
@@ -76,6 +79,9 @@
7679
#include <libintl.h>
7780
#endif
7881

82+
/* Pull in fundamental symbols that we also expose to applications */
83+
#include "postgres_ext.h"
84+
7985
/* Define before including zlib.h to add const decorations to zlib API. */
8086
#ifdef HAVE_LIBZ
8187
#define ZLIB_CONST

0 commit comments

Comments
 (0)