PDA

View Full Version : not an opengl question (c++ macros)



Phoenix
12-04-2003, 10:19 AM
Sorry for this silly question that probably doesn't fit in an opengl forum, but I think you can help me anyway.

I have a problem with C++ macros, I did the following:

#define FSQRT(x)
__asm
{
fld #x fsqrt fstp #x fwait }

of course this code cannot work because when you invoke FSQRT(var) for example, the #x preprocessor command is replaced with "var" and not var...
...do you know how to make this work?
Thanx!

Relic
12-05-2003, 01:00 AM
You need either none or two ##.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/prepr_15.asp