[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: String formatting with APR_INT64_T etc. & gettext localization

From: Mattias Engdegård <mattiase_at_bredband.net>
Date: Sun, 27 Apr 2014 13:10:24 +0200

>>> 1. Use PRIu64 etc. from <inttypes.h>.
>>
>> Good, if you can get it all to work on Windows.
>
> No problem with a bit of configury magic. See for example <http://code.google.com/p/msinttypes/
> >.

Perhaps – I was mainly thinking about gettext and its runtime. A non-
standard build of it may be required then. (I have never attempted to
build gettext on Windows; it could be utterly trivial for all I know.)

> The patch is a proof of concept, not a final delivery. Sorry, I
> should have said that.

I'm the one who should apologise for not understanding that.

Thank you for pointing out that gettext actually does parse the PRIu64
macros; I didn't know that. The resulting strings in the message
catalog are quite readable too: _("Scrooge has %" PRIu64 " sacks of
gold") becomes "Scrooge has %<PRIu64> sacks of gold", which is fine.

However, preprocessing still seems fragile and messy as well as
unnecessary. If we are going to rely on inttypes.h, we could just as
well use those macros in the source directly, can't we?
Received on 2014-04-27 13:11:10 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.