🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #425

Re: GCC with Xenix Include files

#425
From: Ronald S H Khoo
Date: Wed, 17 Oct 1990 07:27
45 lines
1982 bytes
In article <1990Oct16.081629.106@bbt.se> pgd@bbt.se writes:

> The solution is to edit the include files (are you listening SCO?) in
> the style of:
>	#ifndef SIZE_T_DEFINED
>	typedef unsigned int size_t;
>	#define	SIZE_T_DEFINED
>	#endif

I prefer Chris Torek's solution which is much cleaner, because it means
that you only have to maintain the machine dependent typedefs in ONE file.
It goes something like this:  The vendor (in this case SCO and Microsoft,
I guess) creates a "system" include file for use by the other include files
which simply

	#define _TYPEDEF_SIZE_T	int

and so on for each of these multiply defined system types.  Then, in each
file which wants to typedef size_t

	#include <sys/whatever.h>

	...

	#ifdef  _TYPEDEF_SIZE_T
	typedef _TYPEDEF_SIZE_T size_t
	#undef  _TYPEDEF_SIZE_T
	#endif

I thought it was really neat when I saw it.  Now who's first to market? :-)

Steve's just suggested an even neater solution:  have a directory
/usr/include/typedef with files like size_t.h containing ONE of the
traditional

	#ifndef SIZE_T_DEFINED
	typedef unsigned int size_t;
	#define	SIZE_T_DEFINED
	#endif

per each.  And have thousands of #include <typedef/*.h> in your include
files.  Might slow compilations down a little, though :-)
I think, given UNIX, Chris's solution is probably more "practical" :-)
-- 
ronald@robobar.co.uk +44 81 991 1142 (O) +44 71 229 7741 (H)
Technical Details
Message-ID: <1990Oct17.072758.6197@robobar.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!stl!robobar!ronald
References: <1990Oct14.161854@cs.yale.edu> <1990Oct16.081629.106@bbt.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!stl!robobar!ronald
From: ronald@robobar.co.uk (Ronald S H Khoo)
Newsgroups: gnu.gcc.help,comp.unix.xenix.sco
Subject: Re: GCC with Xenix Include files
Message-ID: <1990Oct17.072758.6197@robobar.co.uk>
Date: 17 Oct 90 07:27:58 GMT
References: <1990Oct14.161854@cs.yale.edu> <1990Oct16.081629.106@bbt.se>
Organization: Robobar Ltd., Perivale, Middx., ENGLAND.
Lines: 45