qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] Introduce macro for defining qdev propertie


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 2/2] Introduce macro for defining qdev properties
Date: Fri, 17 Jul 2009 18:33:32 +0100
User-agent: KMail/1.11.4 (Linux/2.6.29-2-amd64; KDE/4.2.4; x86_64; ; )

On Friday 17 July 2009, Blue Swirl wrote:
> On Fri, Jul 17, 2009 at 5:41 PM, Anthony Liguori<address@hidden> wrote:
> > This patch introduces macros for defining qdev properties.  The default
> > macro is clever enough to infer the type of the structure field and to
> > automatically generate a name for the property.  Additional macros are
> > provided that allow infered values to be overridden along with a set of
> > macros to define properties with default values.
>
> Maybe for sake of non-GCC compatibility we should use less clever but
> compatible macros, like
> QDEV_PROP_NAME_DEFVAL_I32
> QDEV_PROP_NAME_DEFVAL_I64
> QDEV_PROP_NAME_DEFVAL_PTR
> QDEV_PROP_NAME_DEFVAL_CHRDEV
> etc?

I think I agree. Using GCC extensions for error checking (e.g. DO_UPCAST) or 
performance (__builtin_clz) is fine, but I'm a reluctant to rely on it for 
correct operation.

Paul





reply via email to

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