Subject: Re: GRRR! Now all my xterms are dying.
To: Christos Zoulas <firstname.lastname@example.org>
From: Robert Elz <kre@munnari.OZ.AU>
Date: 12/16/1998 23:37:09
Date: Wed, 16 Dec 1998 05:50:34 -0500
From: email@example.com (Christos Zoulas)
| | I think sys/tty.h should #include the new opt_compat_43.h as it does the
| | other opt_compat_... include files.
| Thanks, I'll do that.
Actually, that's not the best method, doing this causes everything that
includes <sys/tty.h> to end up depending upon opt_compat_43.h (and hence be
recompiled if that option is altered) even when there is no logical reason
The correct place for the extra include is in those .c files which actually
need the definition.
The #if in <sys/tty.h> is just for a function prototype - if that isn't
included then there should be compiler warnings (and consequently errors
because of the compilation flags) anywhere the opt_* file isn't included
where it is needed, so that one is a non-issue.
Then there's the COMPAT_OLDTTY define - that one is a nuisance, having
conditional compilation defines defined inside header files is truly an
abominable thing to do (even worse, conditionally defined there). Much
better would be to move that out into the config files, and if the defopt
mechanism permits - make it be automatically defined if any of the options
that require it (COMPAT_43 COMPAT_SUNOS COMPAT_SVR4 or COMPAT_FREEBSD) is
defined. Even if it can't be automated, a comment in the config files would
be almost good enough.
Then defopt it, and #include "opt_compat_oldtty.h" in the .c files that
test the COMPAT_OLDTTY define.
That's better than including opt_compat_43.h from <sys/tty.h> (which would
then require being inside "#ifdef KERNEL" of course) - and which, to be
logical, would also require includes of "opt_compat_sunos.h" etc as well).