From owner-freebsd-stable Fri Jul 7 6:20:19 2000 Delivered-To: freebsd-stable@freebsd.org Received: from smtp2.vnet.net (smtp2.vnet.net [166.82.1.32]) by hub.freebsd.org (Postfix) with ESMTP id AB41437BD79 for ; Fri, 7 Jul 2000 06:20:15 -0700 (PDT) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp2.vnet.net (8.10.1/8.10.1) with ESMTP id e67DK7Z28356; Fri, 7 Jul 2000 09:20:11 -0400 (EDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.2/8.8.5) with ESMTP id JAA30573; Fri, 7 Jul 2000 09:20:06 -0400 (EDT) Received: (from rivers@localhost) by lakes.dignus.com (8.9.3/8.6.9) id JAA86645; Fri, 7 Jul 2000 09:20:06 -0400 (EDT) Date: Fri, 7 Jul 2000 09:20:06 -0400 (EDT) From: Thomas David Rivers Message-Id: <200007071320.JAA86645@lakes.dignus.com> To: gram@cequrux.com, king@sstar.com Subject: Re: Any chance of changing struct member names in nameser.h? Cc: freebsd-stable@FreeBSD.ORG In-Reply-To: <3ab0baefb12d7472b9def36580f56874@cequrux.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > Actually, I was wronng - the nameser.h in contrib/bind is fine. But the > > > one in include/arpa/nameser.h is not, so this *is* specific to > > > FreeBSD/KAME... > > > > imho, the right way to handle this is in your source, using an 'extern "C"' > > directive to tell the compiler that it's including a C header and not a C++ > > header. e.g. > > > > extern "C" { > > #include > > } > > > > If the #include directive is in another header file that might be used in > > both C and C++ programs you'd probably want to put some '#ifdef __cplusplus' > > around the extern's. See section 9.2.4 in Stroustrup 3rd edition for a good > > example. > > Great idea, except I thought of that long ago and it doesn't work. > > gram Nope - it wouldn't. extern "C" doesn't mean "The following source is C code" what it means is that any external linkage generated will use C linkage conventions. For most C++ implementations, this means "don't mangle function names". The source within an `extern "C"' block has to be parsable by the C++ parser... it's still C++. For example, you can't say: extern "PASCAL" { ... pascal source ... } and expect that to work... That's my understanding of how this works, anyway... - Dave R. - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe (370) `C' compiler at http://www.dignus.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message