Gettext and INT64_FORMAT - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Gettext and INT64_FORMAT
Date
Msg-id Pine.LNX.4.44.0209022123040.1134-100000@localhost.localdomain
Whole thread Raw
List pgsql-hackers
Gettext cannot handle compile-time string concatenation with macros.  This
is a made-up example:
   printf(gettext("now at file position " INT64_FORMAT), (int64) offset);

At the time when the message catalogs are extracted, INT64_FORMAT is
unknown.

The solution in the Gettext manual is to rewrite the code like this:
   char buf[100];   sprintf(INT64_FORMAT, (int64) offset);   printf(gettext("now at file position %s"), buf);

Since the only affected cases are a few low-probability error messages in
the sequence code and in pg_dump this isn't an aesthetic disaster, so I
plan to fix it along those lines.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_dump compatibility between 7.3 and 7.2?
Next
From: Vince Vielhaber
Date:
Subject: Re: DNS change for candle.pha.pa.us