Compilation on windows

Chris Hulbert chris.hulbert at
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
Change line 138 of ev_select.c from:

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


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

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: "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