ws2_32: Include inttypes.h for UINT32_MAX.

Francois Gouget fgouget at free.fr
Wed Apr 29 05:22:21 CDT 2015


On Wed, 29 Apr 2015, Henri Verbeet wrote:
[...]
> Arguably it shouldn't be using UINT32_MAX at all, since it isn't
> actually used with uint32_t. I guess it should be using e.g. unsigned
> int with UINT_MAX instead.

The timeout receives a 64 bit value so using an unsigned int would not 
work. But using UINT_MAX plus the native limits.h can work.

static inline INT64 get_rcvsnd_timeo( int fd, BOOL is_recv)
...
            timeout = get_rcvsnd_timeo(fd, optname == WS_SO_RCVTIMEO);
            *(int *)optval = timeout <= UINT32_MAX ? timeout : UINT32_MAX;

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
     You can have my guns when you pry them from my kids cold, dead hands.



More information about the wine-devel mailing list