Re: Cannot find a working 64-bit integer type on Illumos
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Tom Lane <tgl@sss.pgh.pa.us>,
Japin Li <japinli@hotmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-03T13:24:47Z
Lists: pgsql-hackers
On 30.11.24 00:42, Thomas Munro wrote:
> On Fri, Nov 29, 2024 at 11:12 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>> New idea: let's just redefine PRI...{32,64,PTR} on that platform,
>> instead of modifying snprintf.c.
>
> D'oh, that's not going to fly. gettext() would replace %<PRId64> with
> the system's PRId64, so we can't avoid teaching our snprintf.c to
> understand Windowsian format strings. Here's a first attempt at that.
> Tested a bit by removing the #ifdef WIN32 locally and playing around
> with it. CI passes on Windows, and I think that should be exercising
> it via existing [U]INT64_FORMAT in various places that would break if
> it didn't work.
This patch looks good to me.
In meson.build, this comment seems to be misplaced by accident:
+# Check if __int128 is a working 128 bit integer type, and if so
+# define PG_INT128_TYPE to that typename.
cdata.set('SIZEOF_VOID_P', cc.sizeof('void *', args: test_c_args))
cdata.set('SIZEOF_SIZE_T', cc.sizeof('size_t', args: test_c_args))
In c.h, you include <inttypes.h> instead of <stdint.h>. Is there a
reason for that?
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