I want to make a C macro to replace an if statement.
I've never been able to get a good grasp of C macros, do I need to do token pasting?
#define BROWSER_HTML_HOW_OPENTAG 0x19939292
structure { dword how; } _tag;
structure { _tag cur_tag; } _ibot;
// works fine
foo()
{
_ibot*ibot;
if(ibot->cur_tag->how==BROWSER_HTML_HOW_OPENTAG) { } // do something
}
but I want to implement this
#define browserTagCheck(tag,how) (tag->how==how)
foo()
{
_ibot*ibot;
if(browserTagCheck(ibot->cur_tag,BROWSER_HTML_HOW_OPENTAG) {} // do something
}
I get an error:
error: expected identifier before numeric constant|