[英]C prototype of a function with define name_fn in a body
Could you help me understand what the following piece of code means? 您能否帮助我理解以下代码的含义? Specifically, I do not understand what the effect of
name_fn
is. 具体来说,我不了解
name_fn
的作用。
#define name_fn
void name_fn Function(void);
The macro name_fn
expands to nothing during pre-processing. 预处理期间宏
name_fn
扩展为空。 So the next line is same as 所以下一行与
void Function(void);
Empty #define
is useful for compatibility, self documentation and/or mechanical checking. 空的
#define
可用于兼容性,自我记录和/或机械检查。
For example, in socket programming, you may encounter : 例如,在套接字编程中,您可能会遇到:
SOCKET WSAAPI
accept (IN SOCKET s,OUT struct sockaddr FAR* addr, OUT int FAR* addrlen );
Here IN
and OUT
are empty macros. IN
和OUT
是空宏。 They 他们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.