Re: cvs commit: apr/network_io/win32 sendrecv.c

2004-10-01 Thread Jean-Jacques Clar

 "William A. Rowe, Jr." [EMAIL PROTECTED] 09/28/04 5:10 PM 
#ifdef DWORD_MAX#define APR_DWORD_MAX DWORD_MAX#else#define DWORD_MAX 4294967295UL#endifWhat 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

2004-10-01 Thread Greg Marr
At 01:06 PM 10/1/2004, Jean-Jacques Clar wrote:
 William A. Rowe, Jr. [EMAIL PROTECTED] 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 0xUL
#endif
Defining DWORD_MAX at all could cause problems if it was defined by a 
later header file.



Re: cvs commit: apr/network_io/win32 sendrecv.c

2004-10-01 Thread William A. Rowe, Jr.
At 12:21 PM 10/1/2004, Greg Marr wrote:

#ifdef DWORD_MAX
#define APR_DWORD_MAX DWORD_MAX
#else
#define APR_DWORD_MAX 0xUL
#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

2004-10-01 Thread Allan Edwards
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 0xUL
#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 0x 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 0xUL
Allan