From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQNLF-0006De-Cq for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:21:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQNL8-00069W-ON for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:21:19 -0400 Received: from [199.232.76.173] (port=43371 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQNL7-00068H-Br for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:21:13 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42344) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQNL3-0007IW-6v for qemu-devel@nongnu.org; Mon, 13 Jul 2009 11:21:09 -0400 Message-ID: <4A5B5067.8070106@redhat.com> Date: Mon, 13 Jul 2009 17:19:03 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/7] add strify() macros. References: <1247478048-17257-1-git-send-email-kraxel@redhat.com> <1247478048-17257-3-git-send-email-kraxel@redhat.com> <4A5B3CB0.7070604@codemonkey.ws> In-Reply-To: <4A5B3CB0.7070604@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Paul Brook 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