9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Steve Simon" <steve@quintile.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] trouble with include order using c compiler with ansi preprocessor
Date: Mon, 11 Jun 2007 08:51:04 +0100	[thread overview]
Message-ID: <1957f65d7213f39bafd1e8d86546e53f@quintile.net> (raw)
In-Reply-To: <FB65AFB7-321D-4515-B1A7-E14AD3097314@tinker.com>

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


      parent reply	other threads:[~2007-06-11  7:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 16:35 Kim Shrier
2007-06-10 17:27 ` [9fans] trouble with include order using c compiler with ansi Charles Forsyth
2007-06-10 17:44   ` Kim Shrier
2007-06-10 18:10 ` [9fans] trouble with include order using c compiler with ansi preprocessor Martin Neubauer
2007-06-10 19:24   ` Kim Shrier
2007-06-10 19:26   ` erik quanstrom
2007-06-10 20:07     ` Russ Cox
2007-06-10 20:44     ` Kim Shrier
2007-06-10 22:02       ` Uriel
2007-06-10 22:47         ` Kim Shrier
2007-06-11  0:10           ` Kris Maglione
2007-06-11  1:41             ` Kim Shrier
2007-06-11  7:51       ` Steve Simon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1957f65d7213f39bafd1e8d86546e53f@quintile.net \
    --to=steve@quintile.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).