qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes


From: Jan Kiszka
Subject: Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes
Date: Fri, 28 Nov 2008 13:17:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Christoph Egger wrote:
> On Friday 28 November 2008 12:34:54 Jan Kiszka wrote:
>> Christoph Egger wrote:
>>> Hi,
>>>
>>> This is a series of four patches which improve support
>>> for qemu on NetBSD.
>>>
>>> sys-queue.h defines _SYS_QUEUE_H_ which is also defined by
>>> the <sys/queue.h> system header. <sys/disk.h> uses SLIST_ENTRY
>>> on NetBSD, which doesn't exist in sys-queue.h. Therefore,
>>> include <sys/queue.h> before including sys-queue.h.
>> Does this patch (which my mail client unfortunately refuses to cite...)
>> take into account that we now have TAILQ_FOREACH_SAFE which NetBSD may
>> lack?
> 
> Yes, NetBSD has it:
> 
> #define TAILQ_FOREACH_SAFE(var, head, field, next)                      \
>         for ((var) = ((head)->tqh_first);                               \
>                 (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1);  \
>                 (var) = (next))
> 
> Another option to this patch would be:
> 
> Renaming _SYS_QUEUE_H_ to QEMU_SYS_QUEUE_H_
> at least allows to include both sys-queue.h and <sys/queue.h>.
> 
> If the macros are not compatible, gcc prints a warning about
> redefining them. Using the -Wredundant-decls warning flag, gcc
> always prints a warning when you try override or duplicate macro
> defines and function declarations.

I don't think allowing inclusion of both headers in their current form
is a good idea. But we may try harder to make the best out of the host's
sys/queue.h and provide missing support in form of

#ifndef MACRO_XYZ
#define MACRO_XYZ ...
#endif

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux




reply via email to

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