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: [PATCH 1/4] Add architecture specific socket.h header



On 21-03-2016 20:11, Joseph Myers wrote:
> On Mon, 21 Mar 2016, Adhemerval Zanella wrote:
> 
>> To avoid namespace pollution socket.h can not include limits.h to
>> get LONG_MAX and INT_MAX, so the option is either using compiler
>> builtin defintions (__LONG_MAX__ and __INT_MAX__) or by creating
>> archicteture specific headers.  The first option has the downside
>> of relying on existense of builtin, which might not be true for all
>> current compilers.
> 
> The normal approach is to include <bits/wordsize.h>.  That should avoid 
> any need for architecture-specific variants of socket.h.
> 

I though about using __WORDSIZE == 64 as the compiler test to check if
sizeof (size_t) is larger than sizeof (socklen_t), but I was not sure
how safe it is for all the architectures.  It seems to be ok for
all current ports though.  I will change that.


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