Re: Cannot find a working 64-bit integer type on Illumos

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Japin Li <japinli(at)hotmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Cannot find a working 64-bit integer type on Illumos
Date: 2024-11-29 23:42:53
Message-ID: CA+hUKGK7WQX3nTuYbiiGZFcV70CqbmBx4VUOnDy6ZGm1v=qGqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 29, 2024 at 11:12 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)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.

It would be nice to see it working via gettext() too, but NLS seems to
be disabled on that OS in CI (and also the BF). Huh, that seems
non-ideal. Transcripts on pgsql-bugs show it working on that OS
though (with occasional encoding glitches, apparently), so I guess the
EDB build must have it enabled.

I tried out the gettext() support for this on Unix. I didn't bother
with xgettext etc, I just manually added a message to fr.po to test
the runtime based on an example in another project, and it worked
unsurprisingly:

- errmsg("REJECT_LIMIT (%lld) must be
greater than zero",
- (long long) reject_limit)));
+ errmsg("REJECT_LIMIT (%" PRId64 ")
must be greater than zero",
+ reject_limit)));

+#, c-format
+msgid "REJECT_LIMIT (%<PRId64>) must be greater than zero"
+msgstr "REJECT_LIMIT (%<PRId64>) doit être supérieure à zéro"

postgres=# copy t from '/dev/null' with (reject_limit -1);
ERREUR: REJECT_LIMIT (-1) doit être supérieure à zéro

Attachment Content-Type Size
v6-0001-Use-stdint.h-and-inttypes.h-for-integer-types.patch text/x-patch 51.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tsinghualucky912@foxmail.com 2024-11-30 00:38:48 Re: Re: Added prosupport function for estimating numeric generate_series rows
Previous Message Tom Lane 2024-11-29 23:36:35 Re: Converting SetOp to read its two inputs separately