2007年12月16日星期日

讨厌的兼容性

kfogelr28368 中引入了:

+ _("Invalid length (%" APR_UINT64_T_FMT ") "
+ "when about to read a string"), len);
从而造成 xgettext 错误:

#: ../libsvn_repos/reporter.c:168
msgid "Invalid length (%"
msgstr ""
但是又不能简单的使用“llu”来替换“APR_UINT64_T_FMT”,因为在 64bit 中不支持“llu”。所以只能使用折中方案:
--- subversion/libsvn_repos
/reporter.c (revision 28499)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -155,6 +155,7 @@
{
apr_uint64_t len;
char *buf;
+ char *fmt;

SVN_ERR(read_number(&len, temp, pool));

@@ -164,9 +165,10 @@
string, anyone?) but let's be future-proof anyway. */
if (len + 1 < len)
{
+ fmt = apr_psprintf(pool, _("Invalid length (%%%s) when about to read "
+ "a string"), APR_UINT64_T_FMT);
return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
- _("Invalid length (%" APR_UINT64_T_FMT ") "
- "when about to read a string"), len);
+ fmt, len);
}

buf = apr_palloc(pool, len + 1);






没有评论: