From owner-freebsd-arch Tue Jan 5 16:17:30 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA09727 for freebsd-arch-outgoing; Tue, 5 Jan 1999 16:17:30 -0800 (PST) (envelope-from owner-freebsd-arch@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA09722 for ; Tue, 5 Jan 1999 16:17:26 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id BAA24067 for ; Wed, 6 Jan 1999 01:16:58 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id BAA23689 for freebsd-arch@freebsd.org; Wed, 6 Jan 1999 01:16:57 +0100 (MET) Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.91]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA05105 for ; Tue, 5 Jan 1999 08:48:03 -0800 (PST) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.8.8/8.7.3) id RAA22563; Tue, 5 Jan 1999 17:47:29 +0100 (MET) Message-ID: <19990105174729.A22338@cons.org> Date: Tue, 5 Jan 1999 17:47:29 +0100 From: Martin Cracauer X-To: Alex Zepeda To: freebsd-arch@FreeBSD.ORG Mail-Followup-To: freebsd-arch@FreeBSD.ORG Subject: C++ compatible include files (Re: egcs chokes on netinet/in.h) References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: ; from Alex Zepeda on Thu, Dec 31, 1998 at 01:49:11AM -0800 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [moved to -arch] In , Alex Zepeda wrote: > /usr/include/netinet/in.h:291: ANSI C++ forbids data member `ip_opts' with > same name as enclosing class > struct ip_opts { > struct in_addr ip_dst; /* first hop, 0 w/o src rt */ > char ip_opts[40]; /* actually variable in size */ There's also the key_t issue, a struct in console.h and a typedef to long in types.h (for SysV IPC). Since C++ handles structs automatically as 'typedef struct structname structname;', this breaks C++ as well. I think we need a decision whether we will fix FreeBSD include files to be compatible with ANSI C++. If we decide to do so, the options are: - change the definion - change the definition for C++ only - disable the definition for C++ In my opinion, only the first one makes sense and also in my opinion we should have C++-compatible include files. In case of a decision in this line, I volunteer to: - search for all uses of ip_opts and change these to the new name of the second member in the base FreeBSD system. [If we rename the second member]. - Do the same for key_t. If we rename the struct for the console code I'll change everything in the base FreeBSD system, add a temporary patch to the XFree port and the Linux svga lib and notify XFree to use the new name in the next release. - I'll also fix any port that I suspect will use these or that people point to. This includes monitoring -bugs and -ports for such reports. - Of course, commits are done after a successful `make world`. Yes, I use C++ sometimes :-) Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message