linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Kratzer <kratzers@pa.net>
To: Bryan Christ <bryan.christ@hp.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: standard OS defines
Date: Wed, 22 Aug 2007 16:01:02 -0400	[thread overview]
Message-ID: <200708221601.02890.kratzers@pa.net> (raw)
In-Reply-To: <200708221547.25508.kratzers@pa.net>

On Wednesday 22 August 2007 15:47:25 Stephen Kratzer wrote:
> On Wednesday 22 August 2007 15:28:17 Bryan Christ wrote:
> > Thanks!  This list is exactly what I was looking for.  Too bad there's
> > not a tool for piping to gcc--I was trying to avoid -D.
> >
> > Bryan
>
> This is about as ugly as it gets, but here it is anyway:
>
> echo -e "#ifndef __SOMETHING__\n#define __SOMETHING__\n#endif" | cat -
> infile.c | gcc -x c -o outfile.c -
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

The outfile shouldn't have a .c extension since it's a binary. My bad. The 
following is slightly cleaner, but not much:

sed '1 i\#ifndef __SOMETHING__\n#define __SOMETHING__\n#endif\n' infile.c | 
gcc -x c -o outfile -
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2007-08-22 20:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22 18:35 standard OS defines Bryan Christ
2007-08-22 19:24 ` Stephen Kratzer
2007-08-22 19:28   ` Bryan Christ
2007-08-22 19:47     ` Stephen Kratzer
2007-08-22 19:48       ` Bryan Christ
2007-08-22 20:01       ` Stephen Kratzer [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=200708221601.02890.kratzers@pa.net \
    --to=kratzers@pa.net \
    --cc=bryan.christ@hp.com \
    --cc=linux-c-programming@vger.kernel.org \
    /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).