开发者

What can the macros below be used for?

开发者 https://www.devze.com 2023-02-20 21:13 出处:网络
#define MEMCACHED_COMMAND_GET(arg0开发者_如何学编程, arg1, arg2, arg3, arg4) #define MEMCACHED_COMMAND_GET_ENABLED() (0)
#define MEMCACHED_COMMAND_GET(arg0开发者_如何学编程, arg1, arg2, arg3, arg4)
#define MEMCACHED_COMMAND_GET_ENABLED() (0)

The macros above seems totally useless ,what can they be used for??


There is probably several definitions for those macros, and you will pick one or another depending on a compilation flag. This enable for instance debug information to be provided only when built in debug mode.

For instance, in memcached_dtrace.h, there is something like:

#if ENABLE_DTRACE
...
#define MEMCACHED_COMMAND_GET(arg0, arg1, arg2) \
    __dtrace_memcached___command__get(arg0, arg1, arg2)
#define MEMCACHED_COMMAND_GET_ENABLED() \
    __dtraceenabled_memcached___command__get()
...
#else
...
#define MEMCACHED_COMMAND_GET(arg0, arg1, arg2)
#define MEMCACHED_COMMAND_GET_ENABLED() (0)
...
#endif

Those commands only do something when ENABLE_DTRACE is activated at build time.

0

精彩评论

暂无评论...
验证码 换一张
取 消