You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jean-Jacques Clar <JJ...@novell.com> on 2004/10/01 19:06:27 UTC
Re: cvs commit: apr/network_io/win32 sendrecv.c
>>> "William A. Rowe, Jr." <wr...@rowe-clan.net> 09/28/04 5:10 PM >>>
>#ifdef DWORD_MAX
>#define APR_DWORD_MAX DWORD_MAX
>#else
>#define DWORD_MAX 4294967295UL
>#endif
What about:
#ifndef DWORD_MAX
#define DWORD_MAX 4294967295UL /* 2^32*/
#endif
#define APR_DWORD_MAX DWORD_MAX
Re: cvs commit: apr/network_io/win32 sendrecv.c
Posted by Allan Edwards <ak...@us.ibm.com>.
William A. Rowe, Jr. wrote:
> At 12:21 PM 10/1/2004, Greg Marr wrote:
>
>
>>#ifdef DWORD_MAX
>>#define APR_DWORD_MAX DWORD_MAX
>>#else
>>#define APR_DWORD_MAX 0xFFFFFFFFUL
>>#endif
>>
>>Defining DWORD_MAX at all could cause problems if it was defined by a later header file.
>
>
> ++1, this is the right solution, and infinitely more legible.
Not wishing to flog a dead horse too long...
if DWORD_MAX is picked up from the Windows
headers it is 0xFFFFFFFF and loses the UL
we dutifully added in the #else clause.
My suggestion was to drop the #ifdef DWORD_MAX
and simply have
#define APR_DWORD_MAX 0xFFFFFFFFUL
Allan
Re: cvs commit: apr/network_io/win32 sendrecv.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 12:21 PM 10/1/2004, Greg Marr wrote:
>#ifdef DWORD_MAX
>#define APR_DWORD_MAX DWORD_MAX
>#else
>#define APR_DWORD_MAX 0xFFFFFFFFUL
>#endif
>
>Defining DWORD_MAX at all could cause problems if it was defined by a later header file.
++1, this is the right solution, and infinitely more legible.
Re: cvs commit: apr/network_io/win32 sendrecv.c
Posted by Greg Marr <gr...@alum.wpi.edu>.
At 01:06 PM 10/1/2004, Jean-Jacques Clar wrote:
> >>> "William A. Rowe, Jr." <wr...@rowe-clan.net> 09/28/04 5:10 PM >>>
> >#ifdef DWORD_MAX
> >#define APR_DWORD_MAX DWORD_MAX
> >#else
> >#define DWORD_MAX 4294967295UL
> >#endif
>
>What about:
>
>#ifndef DWORD_MAX
>#define DWORD_MAX 4294967295UL /* 2^32*/
>#endif
>
>#define APR_DWORD_MAX DWORD_MAX
I assume that Bill meant to write:
#ifdef DWORD_MAX
#define APR_DWORD_MAX DWORD_MAX
#else
#define APR_DWORD_MAX 4294967295UL
#endif
or as someone else posted
#ifdef DWORD_MAX
#define APR_DWORD_MAX DWORD_MAX
#else
#define APR_DWORD_MAX 0xFFFFFFFFUL
#endif
Defining DWORD_MAX at all could cause problems if it was defined by a
later header file.