Re: Cannot find a working 64-bit integer type on Illumos
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tomas Vondra <tomas@vondra.me>, Peter Eisentraut <peter@eisentraut.org>,
Heikki Linnakangas <hlinnaka@iki.fi>, Japin Li <japinli@hotmail.com>,
Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-04T23:16:31Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes: > On Thu, Dec 5, 2024 at 10:58 AM Thomas Munro <thomas.munro@gmail.com> wrote: >> On Thu, Dec 5, 2024 at 10:55 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> Could another way be to read pg_config.h before postgres_ext.h? >>> I think the current order was intentional, but maybe the >>> disadvantages outweigh the advantages now. > Seems good to me. Also there were another couple of contortions due > to the older ordering, which we could improve I think? In c.h, I'd put in a very explicit comment in front of pg_config.h. Also, I don't like making it look like postgres_ext.h is of the same ilk as the config headers, since it isn't. So maybe like /* * These headers must be included before any system headers, because * on some platforms they affect the behavior of the system headers * (for example, by defining _FILE_OFFSET_BITS). */ #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 */ /* Pull in fundamental symbols that we also expose to applications */ #include "postgres_ext.h" /* System header files that should be available everywhere in Postgres */ #include <inttypes.h> ... The comment for pg_config_os.h is redundant this way, maybe we could rewrite it as something more useful? Also, there's probably no reason anymore that postgres_ext.h couldn't be placed after those fundamental system headers, and that might be clearer. (I think perhaps the main reason for the existing ordering was to demonstrate that postgres_ext.h could be included before any system headers, and that's no longer a consideration.) I don't especially care for your proposed changes to postgres_ext.h. That substantially expands the footprint of what gets defined by pulling that in, and some users might not care for that. (For example, because they have ordering assumptions similar to what we're dealing with here.) Now you already snuck the camel's nose under the tent by including stdint.h there, and maybe these additional headers wouldn't do any further damage. But I don't see a strong argument to change long-standing external APIs any more than we absolutely must. regards, tom lane
Commits
-
Move pg_int64 back to postgres_ext.h
- e56a601e0678 19 (unreleased) landed
- 409543da5411 18.0 landed
-
pgbench: Make set_random_seed() 64-bit everywhere.
- 53a2a1564ae4 18.0 landed
-
Use PRI?64 instead of "ll?" in format strings (continued).
- a0ed19e0a9ef 18.0 landed
-
Fix order of -I switches for building pg_regress.o.
- f186f90e55b7 17.5 landed
- cb36f8ec2124 18.0 landed
-
libpq: Deprecate pg_int64.
- 3c86223c9982 18.0 landed
-
Use PRI*64 instead of "ll*" in format strings (minimal trial)
- 15a79c73111f 18.0 landed
-
Fix header inclusion order in c.h.
- 71cb352904c1 18.0 landed
-
Use <stdint.h> and <inttypes.h> for c.h integers.
- 962da900ac8f 18.0 landed
-
Remove traces of BeOS.
- a2d9a9b95ad9 18.0 landed
-
More correct way to check for existence of types, which allows to specify
- 15abc7788e66 7.2.1 cited