qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] build fix: xen on NetBSD/amd64


From: Christoph Egger
Subject: Re: [Qemu-devel] [PATCH] build fix: xen on NetBSD/amd64
Date: Fri, 10 Jul 2009 10:19:31 +0200
User-agent: KMail/1.9.7

On Thursday 09 July 2009 21:21:06 Anthony Liguori wrote:
> Christoph Egger wrote:
> > Hi!
> >
> > Attached patch fixes this build error on NetBSD/amd64:
> >
> > hw/xen_blkif.h:20: warning: #pragma pack(psuh[, id], <n>) is not
> > supported on this target
> > hw/xen_blkif.h:36: warning: #pragma pack(pop[, id], <n>) is not supported
> > on this target
> >
> > Signed-off-by: Christoph Egger <address@hidden>
>
> You'll invoke the fury of malc for introducing an identifier that begins
> with '__' :-)

In NetBSD, there is this in <sys/cdefs.h> :

#if __GNUC_PREREQ__(2, 7)
#define __packed        __attribute__((__packed__))
#define __aligned(x)    __attribute__((__aligned__(x)))
#define __section(x)    __attribute__((__section__(x)))
#elif defined(__PCC__)
#define __packed        _Pragma("packed 1")
#define __aligned(x)    _Pragma("aligned " __STRING(x))
#define __section(x)    _Pragma("section " ## x)
#elif defined(__lint__)
#define __packed        /* delete */
#define __aligned(x)    /* delete */
#define __section(x)    /* delete */
#else
#define __packed        error: no __packed for this compiler
#define __aligned(x)    error: no __aligned for this compiler
#define __section(x)    error: no __section for this compiler
#endif


> There really isn't pragma pack on NetBSD?  That's ashame.

No. Above defines are sufficient and portable.
Now you know where the __aligned define in my patch comes from. :-)

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632





reply via email to

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