- 论坛徽章:
- 0
|
请问一下FreeBSD的头文件中有关函数声明语句怎么理解?
#if defined (__STDC__)
#define __P(x) x
#else
#define __P(x) ()
#endif
That is,
If __STDC__ is defined (by compiler),
int accept __P((int, struct sockaddr *, socklen_t *)); means
int accept {int, struct sockaddr *, socklen_t *);
It is so-called the standard style of function decleration. (ANSI)
Otherwise, say __STDC isn't defined.
int accept __P((int, struct sockaddr *, socklen_t *)); means
int accept ();
It is so-called the traditional style of function decleration. |
|