🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #315

Re: Problems with #include <unistd.h>

#315
From: Bert Driehuis
Date: Mon, 31 Aug 1992 14:42
22 lines
1460 bytes
hvaisane@cs.joensuu.fi (H. Vaisanen) writes:
>I am using gcc version 2.2.2 in DECstation 3100 under Ultrix V4.2

>When I do #include <unistd.h> I get error messages for conflicting
>types of functions, like this:

>/usr/local/gnu/lib/g++-include/unistd.h:57:
>  conflicting types for `int  chown (const char *, short int, short int)'
I ran into the same thing on BSDI (but for slightly different calls), and
went around it by adding "#define chown __hide__chown" before the
"#include_next <stdlib.h>", and a corresponding "#undef chown" after.
Be sure to put them around the correct #include_next, there are two in
each file. In some of the libg++ supplied files you'll see the same approach.

Seeing that the distributed files do the same, I am left wondering why
the original is included in the first place. I guess that the #include_next
is to pick up local differences in symbolic constants, etcetera. In that
case, wouldn't it be a good idea to protect all calls defined in the libg++
include files in the same way?
-- 
Bert Driehuis, driehuis@ooc.uva.nl
Morssingel 243, 2312 EX Leiden, The Netherlands.
Technical Details
Message-ID: <32147@slice.ooc.uva.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!ooc.uva.nl!driehuis
References: <1992Aug28.074934.25241@cs.joensuu.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!ooc.uva.nl!driehuis
From: driehuis@ooc.uva.nl (Bert Driehuis)
Newsgroups: gnu.gcc.help
Subject: Re: Problems with #include <unistd.h>
Message-ID: <32147@slice.ooc.uva.nl>
Date: 31 Aug 92 14:42:10 GMT
References: <1992Aug28.074934.25241@cs.joensuu.fi>
Organization: ooc.uva.nl
Lines: 22