On 30.11.24 00:42, Thomas Munro wrote:
On Fri, Nov 29, 2024 at 11:12 PM Thomas Munro <thomas.mu...@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?