Re: #define FD_SETSIZE SQUID_MAXFD

From: Robert Collins <robertc@dont-contact.us>
Date: 28 Apr 2003 02:52:36 +1000

On Sun, 2003-04-27 at 22:07, Evgeny Kotsuba wrote:
> Hi,
>
> Whats about small change in squid.h to avoid possible warning on
> macro redefinition ?
>
> /* Increase FD_SETSIZE if SQUID_MAXFD is bigger */
> #if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE
>
> #ifdef FD_SETSIZE /* avoid warning on macro redefinition */
> #undef FD_SETSIZE
> #endif
>
> #define FD_SETSIZE SQUID_MAXFD
> #endif

The warning is important: we really don't want to have some headers inc
luded with FD_SETSIZE X, and some with it set to Y. We have to change
the value before it's used anywhere.

If anything, I'd be inclined to make that

#ifdef FD_SETSIZE
#error FD_SETSIZE already defined, cannot redefine safely.
#endif

Rob

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Received on Sun Apr 27 2003 - 10:53:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:43 MST