Can someone explain me what's going on in the code below. As per my knowledge "#define <macro name> <Macro replacement>" doesn't have a semicolon and it's terminated by a new line. But the code line in bold below has a semicolon and is followed by a function declaration. (This is a piece of working, complied code)
Code:
#define CST_CC_ERR LogMsg; s_ReportCSTFailure // Sets __FILE__ and __LINE__
static void s_ReportCSTFailure( const string& msg, int rc, CST_LOG_ID logID, ccAuthViewR* out )
{
const char* func = out ? "ccAuthBus" : "s_ReportCSTFailure";
/*
LogMsg must be called prior to calling this function.
See: CST_CC_ERR
*/
CSTErrorMsg cstMsg( gVendHcst, func, msg, rc, logID );
LogMsgInterface::getInstance() << cstMsg << endl;
if (out)
{
out->m_data.ccauthRespCd = cstMsg.info.number;
if (gVendHcst)
{
rc = CloseCST( gVendHcst );
if (CST_OK != rc)
{
CST_CC_ERR( string(), rc, CST_LOG_ID_CLOSE, 0 );
}
rc = DestroyCST( gVendHcst );
if (CST_OK != rc)
{
CST_CC_ERR( string(), rc, CST_LOG_ID_DESTROY, 0 );
}
gVendHcst = 0;
}
}
} // s_ReportCSTFailure()
Thanks.