Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!tut.cis.ohio-state.edu!ukma!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: How do a write portable programs? Message-ID: <746@proxftl.UUCP> Date: 13 Sep 88 01:43:41 GMT References: <1056@nmtsun.nmt.edu> <404@marob.MASA.COM> Reply-To: bill@proxftl.UUCP (T. William Wells) Organization: Proximity Technology, Ft. Lauderdale Lines: 16 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <404@marob.MASA.COM> daveh@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