Compilation on windows

Chris Hulbert chris.hulbert at gmail.com
Wed Jun 4 06:46:59 CEST 2008


Hi all, here's a little change i had to do to get it to compile on the
windows platform, it may be worth including in the official
distribution?
Change line 138 of ev_select.c from:

res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv);

to:

#ifndef NFDBITS
  res = select (vec_max          , (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv);
#else
  res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv);
#endif

My reasoning is that NFDBITS is undefined in the windows-world, and
indeed the first parameter of the select() function is ignored so it
doesn't matter, we could leave it as zero even.
MSDN corroborates this:
http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx "nfds:
Ignored. The nfds parameter is included only for compatibility with
Berkeley sockets."

What do you all think?



More information about the libev mailing list