国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

c++ - How to define a macro in C to obtain the function name through a function
阿神
阿神 2017-07-04 13:45:23
0
1
1647

How to define a macro to obtain the function name string, as follows:

//某一函數(shù)
void fun0(){
    ....
}

//宏定義
#define GET_NAME(fun) ....... // 這個(gè)怎么寫

//獲取 name=="fun0"
char *name = GET_NAME(fun0)
阿神
阿神

閉關(guān)修行中......

reply all(1)
劉奇

It’s very simple, I’ll give you some black technology:

#define  CLASS_NAME(x)  L#x
#define  METHOD_NAME(x) L#x
#define  LogInfo(str_class,str_method,str_format,...)  \
Log(LogFilter::Info,METHOD_NAME(str_method),CLASS_NAME(str_class), str_format,__VA_ARGS__);

The Log method is defined like this:

void Log(LogFilter filter, wchar_t* classname, wchar_t* methodname, wchar_t* format, ...)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template