Subject: Header structure for mixed Classic/ANSI Date: Mon, 11 Nov 1991 21:45:18 +0200 From: wirzeniu@cs.Helsinki.FI (Lars Wirzenius)
Linus:
> Add a directory "/usr/include/non-ansi", and to each file (example
> ctype.h, cdiff type adding):
>
> #ifndef _CTYPE_H
> #define _CTYPE_H
> + #if !defined(__STDC__) && !defined(__GCC__)
> + #include <non-ansi/ctype.h>
> + #else
>
> ... old ctype.h unchanged (except for the bug-fix, see below)
>
> + #endif /* __STDC__ */
> #endif /* _CTYPE_H */
>
> That way we can keep the non-ansi headers distinct. Anybody got
> something against this? I'd suggest Blum do all the hard work :-) and
> set cdiffs somewhere? No? The non-ansi files could be a part of the C386
> package, and not everyone would need them.
Wouldn't it be easier to make two header trees:
/usr/include/ansi
/usr/include/classic
and either use the -I option to select which tree is used, or put
files like this:
#if __STDC__ == 1 /* not: not just ifdef; see comp.lang.c FAQ */
# include <ansi/foo.h>
#else
# include <classic/foo.h>
#endif
into /usr/include.
This would IMHO be more neat than your proposed solution.