Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jun 2015 13:24:47 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Poul-Henning Kamp <phk@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@FreeBSD.org>,  Ian Lepore <ian@FreeBSD.org>
Subject:   Re: Make "sys/queue.h" usable with C++
Message-ID:  <5576CCFF.5040608@selasky.org>
In-Reply-To: <5576B7C4.2050707@selasky.org>
References:  <52D7D302.3090403@bitfrost.no> <1679.1389879981@critter.freebsd.dk> <52D7E674.4010501@bitfrost.no> <16417.1389881910@critter.freebsd.dk> <1389890913.1230.64.camel@revolution.hippie.lan> <52D8C268.1080009@bitfrost.no> <52D95A8E.3000006@freebsd.org> <55734622.5090808@selasky.org> <29842.1433755547@critter.freebsd.dk> <5576B7C4.2050707@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/09/15 11:54, Hans Petter Selasky wrote:
> On 06/08/15 11:25, Poul-Henning Kamp wrote:
>> It's really a decision if we want to spread dependence on typeof()
>> to /usr/include isn't it ?
>
> Hi Paul-Henning,
>
> I'm aware about the typeof. Without typeof we would have to duplicate
> more of the queue macros, because in C++ you can make lists with both
> structs and classes. Else like some have suggested, we might drop the
> class/struct keyword, but that again will not work in external C
> sections in C++ files.
>

Hi Paul-Henning,

 From what I understand typeof() is a requirement for a C++ compiler 
while for C compilers not. I've update the patch to only use typeof for 
C++ where two different types can arise, and for C compilers keep the 
existing way in sys/queue.h. This also should make extern "C" code work 
assuming that if the C++ compiler supports typeof, it also works inside 
the extern "C".

--HPS




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5576CCFF.5040608>