Subject: Re: getnameinfo type incompatibility
To: None <itojun@iijlab.net>
From: Christos Zoulas <christos@zoulas.com>
List: tech-net
Date: 05/23/2000 10:44:56
On May 23, 10:07pm, itojun@iijlab.net (itojun@iijlab.net) wrote:
-- Subject: Re: getnameinfo type incompatibility
| did you have chance to talk with klaus?
No, but I am getting more and more convinced that klaus is right.
But I don't like much the #define socklen_t socklen_t
| just for comparison, this is a variant which has _BSD_SOCKLEN_T_
| in machine/ansi.h (the comment in sys/arch/*/include/ansi.h may be
| unnecessary).
|
| we have couple of proposals, and the attached diff does the first one.
| - add _BSD_SOCKLEN_T_ into machine/ansi.h
| /* in machine/ansi.h */
| #define _BSD_SOCKLEN_T_ unsigned int
|
| /* in other headers */
| #ifdef _BSD_SOCKLEN_T_
| typedef _BSD_SOCKLEN_T socklen_t;
| #undef _BSD_SOCKLEN_T
There are missing _ at the end of the name.
| #endif
|
| pros: uniform way of declaring commonly used types
| cons: multiple declaration, in sys/arch/*/include/ansi.h
| - add _BSD_SOCKLEN_T_ into sys/ansi.h (thorpej)
| (same as above)
|
| pros: uniform way of declaring commonly used types
| pros: single declaration
| - use new into sys/ansi.h (klaus)
| /* in sys/ansi.h */
| typedef unsigned int __socklen_t;
|
| /* in other headers */
| #ifndef socklen_t
| typedef __socklent_t socklen_t;
| #define socklent_t socklen_t
That should read:
typedef __socklen_t socklen_t;
#define socklen_t socklen_t
| #endif
|
| pros: less reserved #define symbols
| pros: single dectlaration
pros: reusable symbol out of user's namespace.
| cons: why re-invent?
christos