This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: sunrpc/rpc/types.h question
- From: Zack Weinberg <zackw at panix dot com>
- To: Christian Groessler <chris at groessler dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 3 Feb 2016 12:19:44 -0500
- Subject: Re: sunrpc/rpc/types.h question
- Authentication-results: sourceware.org; auth=none
- References: <56B22D4E dot 3050007 at groessler dot org>
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