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