qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/7] add strify() macros.


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 2/7] add strify() macros.
Date: Mon, 13 Jul 2009 17:19:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 07/13/09 15:54, Anthony Liguori wrote:
Gerd Hoffmann wrote:
Could get even fancier with something like:

#define strify_i(a) # a
#define strify(a) strify_i(a)

#define to_prop(a) __builtin_choose_expr( \
__builtin_types_compatible_p(typeof(a), const char []), \
(a), \
__builtin_choose_expr( \
__builtin_types_compatible_p(typeof(a), int) || \
__builtin_types_compatible_p(typeof(a), double), \
strify(a), \
(int *)0))

It should be possible to use to_prop() for any property initializer.

Hmm? This is how related to properties? To me it looks just like a stringify version which accepts strings too and does nothing for them. Not sure why this would be useful ...

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]