Closed tolbrino closed 2 years ago
I don't mind changes to support Windows, but this is a little too invasive; making the macros dependent on a new main() local variable.
I made a weak attempt to port to Windows but abandoned it. The current codebase relies on a few unix-only facilities like <unistd>
. You'll need to completely rewrite main()
since getopt
is not portable, and you'll need to also rip out any use of sys/time.h
. I thought there were a few other issues as well, but this should get you started. It's certainly do-able.
I obsoleted the use of sys/time.h a while ago. I see I still redundantly include it in a few spots; let me take those out right now...
There's also the htonl()
issue. Windows doesn't have <endian.h>
but you can assume all Windows platforms are little-endian.
I've got a working version for Windows already, but need to untangle and rebase that on master. So I thought I start with the standalone bit.
This is needed on Windows because
cl.exe
doesn't support statements in expressions like gcc does.