#define NSLog(format, ...) fprintf(stderr, "<%s : %d> %s ",
[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],
__LINE__, __func__);
(NSLog)((format), ##__VA_ARGS__);
fprintf(stderr, " ------------------ / Hello nice Day! \ \ my Macro Log ~ / ------------------ \ \ ^__^ (OO)\__________ (__)\ )\/\ ||_______ _) || W | YYy ww ww ");
//手动让编译器报警(报错)可以用以下几个方法:
//#warning sunnyxx
//#error sunnyxx
//#pragma message "sunnyxx"
//#pragma GCC warning "sunnyxx"
//#pragma GCC error "sunnyxx"
#define STRINGIFY(S) #S
#define DEFER_STRINGIFY(S) STRINGIFY(S)
#define PRAGMA_MESSAGE(MSG) _Pragma(STRINGIFY(message(MSG)))
#define FORMATTED_MESSAGE(MSG) "[TODO-" DEFER_STRINGIFY(__COUNTER__) "] " MSG " "
DEFER_STRINGIFY(__FILE__) " line " DEFER_STRINGIFY(__LINE__)
#define KEYWORDIFY try {} @catch (...) {}
// 最终使用下面的宏
#define TODO(MSG) KEYWORDIFY PRAGMA_MESSAGE(FORMATTED_MESSAGE(MSG))
// @TODO("dddd");