From: Neil Booth <NeilB@earthling.net>
To: Ross Combs <rocombs@cs.nmsu.edu>
Cc: martin@loewis.home.cs.tu-berlin.de, gcc@gcc.gnu.org
Subject: Re: Compiler Directive to List Defined Macros?
Date: Fri, 30 Jun 2000 01:36:00 -0000 [thread overview]
Message-ID: <E137wEo-0006rn-00@monkey.rosenet.ne.jp> (raw)
In-Reply-To: <200006292249.QAA30985@quito.cs.nmsu.edu>
Ross Combs wrote:-
> Hmm. That is how I originally tried to use it. It is also annoying that
> I couldn't find a way to stringize __LINE__ and then concatenate it to
> __FILE__. But such things can be worked around.
You mean to get output like "\"myfile.c\": 200"? If so, the following
should work:
#define str(x) #x
#define xstr(x) str(x)
xstr(__FILE__: __LINE__)
Or if you want "myfile.c: 200", i.e. without the inner quotes, try
__FILE__ ": " xstr(__LINE__)
If you don't understand why this works, info cpp should help. If it
doesn't, please help us to improve the docs!
Neil.
next prev parent reply other threads:[~2000-06-30 1:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-29 15:49 Ross Combs
2000-06-30 1:36 ` Neil Booth [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-06-30 14:34 Ross Combs
2000-06-29 8:28 Ross Combs
2000-06-29 13:44 ` Martin v. Loewis
2000-06-29 8:18 Ross Combs
2000-06-29 11:38 ` Geoff Keating
2000-06-28 17:19 Ross Combs
2000-06-28 19:40 ` Geoff Keating
2000-06-29 0:39 ` Martin v. Loewis
2000-06-28 6:44 Bolan Meek
2000-06-28 7:27 ` Franz Sirl
2000-06-28 7:35 ` Bolan Meek
2000-06-28 7:56 ` Alexandre Oliva
2000-06-28 8:06 ` Bolan Meek
2000-06-28 8:14 ` Alexandre Oliva
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=E137wEo-0006rn-00@monkey.rosenet.ne.jp \
--to=neilb@earthling.net \
--cc=gcc@gcc.gnu.org \
--cc=martin@loewis.home.cs.tu-berlin.de \
--cc=rocombs@cs.nmsu.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 read-only IMAP folder(s) and NNTP newsgroup(s).