This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sunrpc/rpc/types.h question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]