public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Inquiry on the pre-processor
@ 2001-07-03 23:41 Robboy, David G
  2001-07-04  0:25 ` Keith Owens
  0 siblings, 1 reply; 2+ messages in thread
From: Robboy, David G @ 2001-07-03 23:41 UTC (permalink / raw)
  To: linux-ia64

The C preprocessor doesn't recognize macros that are suffixed on words.  It
likes to substitute whole words. Does anyone know a trick to get it to
substitute text for suffixes?  Someone has to have done this before.

What I want to do specifically is for ia32 assembly language, but the
question is about preprocessing in general.  On certain assembly instruction
opcodes, I want to suffix a macro that can be changed to the letter "b,"
"w," or "l," so that a single source program can operate on different sized
operands. 

Thanks,
David Robboy



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Linux-ia64] Inquiry on the pre-processor
  2001-07-03 23:41 [Linux-ia64] Inquiry on the pre-processor Robboy, David G
@ 2001-07-04  0:25 ` Keith Owens
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Owens @ 2001-07-04  0:25 UTC (permalink / raw)
  To: linux-ia64

On Tue, 3 Jul 2001 16:41:13 -0700, 
"Robboy, David G" <david.g.robboy@intel.com> wrote:
>What I want to do specifically is for ia32 assembly language, but the
>question is about preprocessing in general.  On certain assembly instruction
>opcodes, I want to suffix a macro that can be changed to the letter "b,"
>"w," or "l," so that a single source program can operate on different sized
>operands. 

#define OP_SUFFIX(op) (op##b)

Unfortunately ## only works inside macros so you have to write
OP_SUFFIX(op) instead of op##suffix.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-04  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-03 23:41 [Linux-ia64] Inquiry on the pre-processor Robboy, David G
2001-07-04  0:25 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox