From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 16 13:46:28 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2EB431B for ; Thu, 16 Jan 2014 13:46:28 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id B7F251E4A for ; Thu, 16 Jan 2014 13:46:28 +0000 (UTC) Received: from critter.freebsd.dk (critter-phk.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id AA0903EB93; Thu, 16 Jan 2014 13:46:21 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.7/8.14.7) with ESMTP id s0GDkL6P001680; Thu, 16 Jan 2014 13:46:21 GMT (envelope-from phk@phk.freebsd.dk) To: Hans Petter Selasky Subject: Re: Make "sys/queue.h" usable with C++ In-reply-to: <52D7D302.3090403@bitfrost.no> From: "Poul-Henning Kamp" References: <52D7D302.3090403@bitfrost.no> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 16 Jan 2014 13:46:21 +0000 Message-ID: <1679.1389879981@critter.freebsd.dk> X-Mailman-Approved-At: Thu, 16 Jan 2014 16:33:06 +0000 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2014 13:46:29 -0000 In message <52D7D302.3090403@bitfrost.no>, Hans Petter Selasky writes: >Hi, > >I'm using "sys/queue.h" with some C++ programs. The only problem is that >you cannot make an ENTRY() using classes without getting some compiler >warnings, because all macros in "sys/queue.h" assume "struct". I came >< this close to removing the assumed struct many years ago when I orthogonalized sys/queue.h, but were persuaded by others that it was pointless and that nobody were ever going to use it with C++ anyway, C++ being so much more evolved in such aspects :-) Wouldn't #ifndef SYS_QUEUE_STRUCT # define SYS_QUEUE_STRUCT struct #endif Make more sense ? That would allow C code to also make the struct explicit. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.