[TUHS] run commands at login in v6 and stty

Douglas McIlroy douglas.mcilroy at dartmouth.edu
Mon Feb 28 11:04:55 AEST 2022

> The X11 tree was a heavily ifdef-ed.  And it needed to be, I don't have
> an answer as to how you would reuse all that code on different hardware
> in a better way.

Plan 9 did it with #include. The name of the included file was the same for
every architecture. Only the search path for include files changed. Done with
care, this eliminates the typical upfront #ifdefs.that define constants and set

Other preprocessor conditionals can usually be replaced by a regular if, letting
the compiler optimize away the unwanted alternative. This makes conditionals
obey the scope rules of C.


More information about the TUHS mailing list