Darwin and _BSD_WCHAR_T_DEFINED_

Loren James Rittle rittle@latour.rsch.comm.mot.com
Wed Oct 17 15:07:00 GMT 2001


>Bryce McKinlay wrote:

>> The problem here is that gcc's header undefines _BSD_WCHAR_T_ but does
>> not define _BSD_WCHAR_T_DEFINED_, so if the stddef.h gets included
>> before any of darwin's headers, we get an error like this one:

> What about this patch? I have to apply it to the mainline to bootstrap
> on darwin-1.4.
> Could it be that I(we) have a nasty env setting?
> P.S.  I don't see it on the apple branch so far. (synced yesterday from main)

Although I don't have rights of approval, I should have spoken up
sooner since I am responsible for most of the recent toying with that
area of the file.  The patch looks fine to me since it changes no
(granted, somewhat convoluted) logic paths in the file.  The logic
path changes are what always got me into portability trouble.

I have personally verified that this patch will not negatively impact
any existing version of FreeBSD system headers.  I also took a quick
look at NetBSD and OpenBSD system header history
( http://cvsweb.netbsd.org/bsdweb.cgi/basesrc/include/ )
( http://www.openbsd.org/cgi-bin/cvsweb/src/include/ ) and saw no
issues.  (How I wish more OS vendors would put, at the very least,
their system headers up for AnonCVS via WWW without me having to sign
any blasted paperwork.)

The patch might be improved by placing the definition of the new macro
into a region guarded by a check of a macro which is only available on
a Darwin system.  However, it is clear that we have not always done this.

Regards,
Loren
-- 
Loren J. Rittle
Senior Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672



More information about the Gcc-patches mailing list