zielmicha / reactor.nim

Asynchronous networking engine for Nim
https://networkos.net/nim/reactor.nim/doc/
MIT License
108 stars 6 forks source link

Windows support #3

Open zielmicha opened 8 years ago

zielmicha commented 8 years ago

Make reactor.nim compile on Windows.

hcorion commented 8 years ago

Not exactly 'trivial'. A lot of the code includes posix (at least in the uv folder), and there are some things used that are posix only. I'm unfamiliar with using sockets in both windows and unix so I'm at a loss here. To get started you would have to detect windows or unix/mac and import winlean if windows and posix if posix. Then you'd have to find the windows equivalent for the posix functions and variables used. P.S. It doesn't appear to compile on the latest devel.

zielmicha commented 8 years ago

Actually most of these posix imports are unused (I have no idea why I've added them) and rest are used only for errno.

zielmicha commented 8 years ago

Anyway, it compiles for me on latest devel (emit tons of warnings, I've just fixed them). Could you post an error message?

hcorion commented 8 years ago

Oh, interesting. It appears to be my installation of nim that is the problem. I'm getting casting errors, reactor\uv\uvstream.nim(33, 18) Error: type mismatch: got (int, culong) I'll look into it, probably a problem with my installation.

zielmicha commented 8 years ago

This is caused by bad definition of uv_buf_t for Windows - this is one of these things that need adjusting.

zielmicha commented 7 years ago

698a9f194c is nearly there, but there are still some problems with linker.