sunrpc/rpc/types.h question
Zack Weinberg
zackw@panix.com
Wed Feb 3 17:19:00 GMT 2016
On Wed, Feb 3, 2016 at 11:39 AM, Christian Groessler
<chris@groessler.org> wrote:
> aren't these typedefs backwards?
>
> #ifndef __u_char_defined
> typedef __u_char u_char;
> typedef __u_short u_short;
> typedef __u_int u_int;
> ....
No, this is the right way around. __u_char etc are already defined at
this point, and are being used to define u_char etc. You may have
been confused by the macro __u_char_defined, which is defined when
u_char is defined, *not* when __u_char is defined. If we had a macro
to tell us whether __u_char had been defined (we don't, AFAICT, nor do
we need one) that macro would be named ____u_char_defined.
(Note also that the rpc headers are very old and mostly unmaintained,
and used only by programs that are also very old and mostly
unmaintained, which means - if this *were* the wrong way around, it
would probably be necessary to keep it that way for compatibility's
sake.)
zw
More information about the Libc-alpha
mailing list