generic pointers without ANSI C

Doug Gwyn gwyn at brl-smoke.ARPA
Wed Feb 24 23:49:17 AEST 1988


In article <43 at vsi.UUCP> friedl at vsi.UUCP (Stephen J. Friedl) writes:
>        #define generic char

Given the current state of C implementations, you probably have some
sort of system-dependent configuration header that you #include in
your applications (mine is called <std.h>).  You can use such a
header to provide system-independent types; for example mine has
	typedef char *pointer;	/* void * if you have it */
Then your application need not be modified during porting, just the
system-dependent configuration header.

This can obviously be carried to an extreme; you should use it mainly
for those things that cannot be done portably in this pre-ANSI C era.
(Mine also introduces a "bool" data type, which supports my style of
coding, but that's not a portability issue.)



More information about the Comp.lang.c mailing list