How do a write portable programs?

T. William Wells bill at proxftl.UUCP
Tue Sep 13 11:43:41 AEST 1988


In article <404 at marob.MASA.COM> daveh at marob.masa.com (Dave Hammond) writes:
: I suggest separating the code into application-level (code which should never
: be concerned with the processor its running on) and system-level (device
: i/o, subprocess control, signal handling, etc) routines.  Then develop a
: standard interface between the 2 levels.  In this way you should only have to
: heavily #ifdef the system-level routines.  For example, if echo is the
: question, your application-level code might call a function Set_Echo_Off()
: [a system-level routine] which should contain the #ifdefs relevant to echo
: handling on various systems.

Better yet, unless the system specific files are very similar, create
separate files for each system.

---
Bill
novavax!proxftl!bill



More information about the Comp.lang.c mailing list