delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/07/18/07:52:36

Date: Tue, 18 Jul 2000 14:23:47 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Laurynas Biveinis <lauras AT softhome DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: GCC headers and DJGPP port
In-Reply-To: <39742B45.D30B4051@softhome.net>
Message-ID: <Pine.SUN.3.91.1000718141739.2467C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 18 Jul 2000, Laurynas Biveinis wrote:

> Eli Zaretskii wrote:
> > > + #undef SIZE_TYPE
> > > + #define SIZE_TYPE "long unsigned int"
> > 
> > I'm not sure I understand what exactly is this suggestion.  Where should
> > this snippet go, and how would it solve the problem(s) at hand?
> 
> It would go to GCC source, target description header file. 
> The explanation was earlier in this thread:

Yes, I saw that explanation, but I don't really know what target.h is ;-).

Putting the same definitions as used by DJGPP in target.h is semi-okay: 
we need to be sure that these definitions won't change too often, 
otherwise we create incompatibility between GCC and the library.

While size_t will probably not change too much, wchar_t might, especially 
if someone adds real multibyte character support to the library.

> > Actually, I don't think I understand why stddef.h needs to be included
> > instead of djtypes.h.  Could you please explain?
> 
> Let's say we've converted to GCC headers. Now some header wants to get 
> size_t. Earlier he was including <sys/djtypes.h>. But now the only header
> which knows about size_t is <stddef.h>, but including it is prohibited.
> Thus there is a backdoor - you define __need_size_t, __need_null, etc.
> and include <stddef.h>. Then it will silently give out only requested
> definitions and nothing else.

I understand that __need_size_t etc. are tested inside stddef.h, yes?  
Are we sure these ifdef's inside stddef.h will stay?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019