From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1957f65d7213f39bafd1e8d86546e53f@quintile.net> From: "Steve Simon" Date: Mon, 11 Jun 2007 08:51:04 +0100 To: 9fans@cse.psu.edu Subject: Re: [9fans] trouble with include order using c compiler with ansi preprocessor In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 7d37a2be-ead2-11e9-9d60-3106f5b1d025 The "plan9 way" to solve the problem of supporting different OSs in your program is to factor out the os specific parts and put them in a single file (eg macos.c linux.c, plan9.c etc) and a matching set of makefiles (make.macos, make.unix, (plan9 would have a mkfile of course)). The best example of this I know is portable version of the sam the editor /sys/src/cmd/unix/sam - sadly the plan9 version has diverged from this over the years but the principal is still valid. -Steve