[systemd-devel] [PATCH] include: fix problem with __LINE__ macro expansion

Lukasz Skalski l.skalski at partner.samsung.com
Fri Nov 22 06:54:42 PST 2013


On 11/22/2013 02:46 PM, David Herrmann wrote:
> Hi
>

Hi,

> On Fri, Nov 22, 2013 at 2:09 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
>> On Thu, 21.11.13 17:26, Lukasz Skalski (l.skalski at partner.samsung.com) wrote:
>>
>>> Hi all,
>>>
>>> Macro __LINE__ in #define assert_cc() (src/shared/macro.h) is not
>>> properly expanded.
>>>
>>> Please find patch in attachment for review.
>>
>> Thanks! Seems David Herrmann has now fixed this thing slightly
>> differently.
>
> I just noticed the compile-failure and fixed it up myself. But this
> patch definitely looks nicer. I now changed the helper-name to
> XCONCATENATE similar to XSTRINGIFY and added a UNIQUE macro to
> generate a unique name. Might be useful in other macros, too.
>
> Thanks
> David
>

Thanks. Solution with XCONCATENATE seems to be more generic than 
assert___cc(expr,line) macro and can be re-used.

BR,
-- 
Lukasz Skalski
Samsung R&D Institute Poland
Samsung Electronics
l.skalski at partner.samsung.com


More information about the systemd-devel mailing list