H
Howard
Hi,
I need to be able to define some code for one platform but not another,
where the code consists of preprocessor definitions. I'm trying to use a
macro (yuk), but having trouble (no surprise). The problem seems to be
trying to include preprocessor definitions inside the macro. These need to
be on their own line, but the macro expansion puts everything on the same
line. Is there any way to include preprocessor definitions in a macro? I
really don't like having to write out the code manually every place I need
it. Here's the code I need to add (in quite a few places):
#ifdef WIN32
#ifndef _DEBUG
#pragma code_seg(".ftext")
#endif
#endif
....some code functions go here, then...
#ifdef WIN32
#ifndef _DEBUG
#pragma code_seg()
#endif
#endif
It would be nice if I could just write:
CODESEG_ON()
....some code functions go here, then...
CODESEG_OFF()
And have that expand to the above for Windoze, but expand to nothing for
Mac.
Any ideas?
Thanks,
-Howard
I need to be able to define some code for one platform but not another,
where the code consists of preprocessor definitions. I'm trying to use a
macro (yuk), but having trouble (no surprise). The problem seems to be
trying to include preprocessor definitions inside the macro. These need to
be on their own line, but the macro expansion puts everything on the same
line. Is there any way to include preprocessor definitions in a macro? I
really don't like having to write out the code manually every place I need
it. Here's the code I need to add (in quite a few places):
#ifdef WIN32
#ifndef _DEBUG
#pragma code_seg(".ftext")
#endif
#endif
....some code functions go here, then...
#ifdef WIN32
#ifndef _DEBUG
#pragma code_seg()
#endif
#endif
It would be nice if I could just write:
CODESEG_ON()
....some code functions go here, then...
CODESEG_OFF()
And have that expand to the above for Windoze, but expand to nothing for
Mac.
Any ideas?
Thanks,
-Howard