Monday, June 16, 2014

Debug preprocessor, デバッグメッセージ

Debug message
#define SHOW_DEBUG_MSG
#ifdef SHOW_DEBUG_MSG
#include 
#include 

#define DEBUG(format, ...) fprintf (stdout, "[DEBUG] %s(%d): " format "\n", __FUNCTION__ ,__LINE__ ,##__VA_ARGS__)
#else
#define DEBUG(...)  (void)0
#endif // DEBUG

No comments: