Binding Libev with Digitalmars' D on windows

Marc Lehmann schmorp at schmorp.de
Mon Jun 9 16:02:52 CEST 2008


On Fri, Jun 06, 2008 at 04:10:45PM +1000, Chris Hulbert <chris.hulbert at gmail.com> wrote:
> If anyone's interested, some details are here, and i'd be interested
> to hear comments on how i've structured the code:
> http://splinter.com.au/blog/?p=15

That doesn't seem to be very difficult (when one knows this beforehand :),
so this inspired me to mention _open_osfhandle in the win32 section and
the following section:

   A typical way to use libev under windows is to embed it (see the embedding 
   section for details) and use the following F<evwrap.h> header file instead 
   of F<ev.h>:

      #define EV_STANDALONE              /* keeps ev from requiring config.h */
      #define EV_SELECT_IS_WINSOCKET 1   /* configure libev for windows select */
      #define EV_STAT_ENABLE 0           /* no stat() availble */

      #include "ev.h"

   And compile the following F<evwrap.c> file into your project (make sure 
   you do I<not> compile the F<ev.c> or any other embedded soruce files!):

      #include "evwrap.h"
      #include "ev.c"

I will look into probably disabling EV_STAT_ENABLE on win32 by default for
the next release (you are not expected to have to do that yourself).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list