摘要:
//利用预编译宏展开特性#define LOCATION Location(__FILE__, __FUNCTION__, __LINE__)inline std::string Location(char *pfile, char *pfunc, int nline){ char buffer[MAX_PATH];// MAX_PATH = 260 sprintf_s(buffer, "%s %s %d", pfile, pfunc, nline); return buffer;}测试了,可行,但,还是用的宏,唔。。。改成这样吧:#define LOCATION Loca 阅读全文