GCC with Xenix Include files
Ronald S H Khoo
ronald at robobar.co.uk
Wed Oct 17 17:27:58 AEST 1990
In article <1990Oct16.081629.106 at bbt.se> pgd at 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 at robobar.co.uk +44 81 991 1142 (O) +44 71 229 7741 (H)
More information about the Comp.unix.xenix.sco
mailing list