C++ ????????????????
???????????? ???????[ 2014/5/9 10:18:13 ] ????????C++ ????? ????
//?????????????????
#define printDebugMsg(moduleName?? format?? ...)
printf( "[%s] "format" File:%s?? Line:%d
"
?? moduleName?? ##__VA_ARGS__?? __FILE__?? __LINE__ );
#endif //end for #ifdef DEBUG_TO_FILE
#else
//???а汾?????????
#define printDebugMsg(moduleName?? format?? ...)
#endif //end for #ifdef _DEBUG
int main(int argc?? char** argv)
{
int data = 999;
printDebugMsg( "TestProgram"?? "data = %d"?? data );
return 0;
}
???????????????????C99?淶??gcc??????????__VA_ARGS__????????????gcc?????????????????gcc???????汾?????__VA_ARGS__??????? ??ο???????????Σ??????????????????????????????????????????????????:
void printDebugMsg( const char* format?? ...)
{
char buffer[DEBUG_BUFFER_MAX_LENGTH + 1]={0};
va_list arg;
va_start (arg?? format);
vsnprintf(buffer?? DEBUG_BUFFER_MAX_LENGTH?? format?? arg);
va_end (arg);
printf( "%s"?? buffer );
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11