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

Re: svn commit: r34145 - in trunk: . subversion www

From: Arfrever Frehtes Taifersar Arahesis <arfrever.fta_at_gmail.com>
Date: Tue, 11 Nov 2008 21:33:10 +0100

2008-11-11 20:57 Julian Foad <julianfoad_at_btopenworld.com> napisaƂ(a):
> On Tue, 2008-11-11 at 11:39 -0800, arfrever_at_tigris.org wrote:
>> (Q_): Add parenthesis around definition for consistency with definitions
>> of other macros.
>
>> -#define Q_(x1, x2, n) (n == 1) ? x1 : x2
>> +#define Q_(x1, x2, n) ((n == 1) ? x1 : x2)
>
> You should parenthesize each argument as well as the whole expression:
>
> (((n) == 1) ? (x1) : (x2))
>
> Otherwise invocations such as
>
> Q_(item[0].is_dir ? "file" : "directory",
> "items",
> number_of_items)
>
> would go wrong.

xgettext doesn't support this syntax, so it's better to cause
compilation failure than untranslated message.
Received on 2008-11-11 21:33:32 CET

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.