From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L62Hh-0000Kc-3E for qemu-devel@nongnu.org; Fri, 28 Nov 2008 07:17:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L62Hf-0000IV-Lo for qemu-devel@nongnu.org; Fri, 28 Nov 2008 07:17:20 -0500 Received: from [199.232.76.173] (port=52505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L62Hf-0000IC-GN for qemu-devel@nongnu.org; Fri, 28 Nov 2008 07:17:19 -0500 Received: from gecko.sbs.de ([194.138.37.40]:22555) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L62He-0003ZB-Ti for qemu-devel@nongnu.org; Fri, 28 Nov 2008 07:17:19 -0500 Message-ID: <492FE14A.6090805@siemens.com> Date: Fri, 28 Nov 2008 13:17:14 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 5/6] qemu fixes References: <200811281139.07092.Christoph.Egger@amd.com> <492FD75E.9040900@siemens.com> <200811281256.54759.Christoph.Egger@amd.com> In-Reply-To: <200811281256.54759.Christoph.Egger@amd.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Egger Cc: Blue Swirl , qemu-devel@nongnu.org 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 system header. uses SLIST_ENTRY >>> on NetBSD, which doesn't exist in sys-queue.h. Therefore, >>> include 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 . > > 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