zoukankan      html  css  js  c++  java
  • NSLog

    #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");

  • 相关阅读:
    autocare使用命令
    使用国内豆瓣源
    HCNA(二)以太网的帧结构
    HCNA(一)网络传输介质
    Python
    Python
    Python
    Delphi
    HCNP
    Python
  • 原文地址:https://www.cnblogs.com/lee4519/p/4456838.html
Copyright © 2011-2022 走看看