原帖由
twuking 于 2007-6-13 10:21 发表
www.linuxeden.com"[3gcPL`-RN
在阅读zebra的路由器协议中发现有这么一段宏定义不知道是什么意思。
p
p"s^
i x)v9t
#define UNSET_IF_PARAM(S, P) ((S)->P##__config) = 0
tOiOw$Jw#define DECLARE_IF_PARAM(T, P) T P; u_char P##__config:1
^/\.jb`/jC0u
*U:~Z"K4EEQHZ第一句中的##__con ...
#include <stdio.h>
#define MAKE_HELLO_FUNC(x) \
void x##_hello(void) \
{ \
printf("Hello, " #x "\n"); \
}
MAKE_HELLO_FUNC(foo)
MAKE_HELLO_FUNC(bar)
int
main(int argc, char * argv[])
{
foo_hello();
bar_hello();
return 0;
}