ACE当中采用的是最后一种方法,所以要可移植性的话还是采用最后一种比较好
#define ACE_DEBUG(X) /
do { /
int __ace_error = ACE_Log_Msg::last_error_adapter (); /
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); /
ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); /
ace___->log X; /
} while (0)
#define ACE_DEBUG(X) /
do { /
int __ace_error = ACE_Log_Msg::last_error_adapter (); /
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); /
ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); /
ace___->log X; /
} while (0)
注意上边加红的地方,不然会被解析为多个参数,然后编译就不会通过