Re: weeding out c++ keywords from sys/sys

From: Andrew Reilly <andrew-freebsd_at_areilly.bpc-users.org>
Date: Mon, 16 Feb 2009 17:07:16 +1100
On Sun, Feb 15, 2009 at 07:11:58PM +0100, Christoph Mallon wrote:
> Michael Butler schrieb:
> > .. stops C++ from mangling the prototyped functions so they'll link
> >correctly but does it temporarily disable the "reserved word" tests?
> >Should it? ;-)
> 
> No, it doesn't. extern $STRING (the standard only requires "C" and 
> "C++", but there can be more) just changes the linkage of declarations 
> (name mangling, calling convention).

I've always wondered: why does the extern "C" {} cruft have to
be pushed into all C headers, rather than being wrapped around
the #include <> lines in the C++ source that includes them?
Then you wouldn't need the #ifdef __cplusplus conditional,
because you already know that it's C++ code.  Common usage seems
to have it backwards, but I assume that there must be a reason.

Cheers,

Andrew
Received on Mon Feb 16 2009 - 05:07:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:42 UTC