Xref: utzoo gnu.gcc.help:21 comp.unix.xenix.sco:506 Path: 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 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 ... #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 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)