Credis Win32 (unofficial, untested, bleeding edge!)

Redis client library for C. I just saw it announced a few hours ago, and hacked on it to compile on Win32.

Download

credis-win32-03122009.zip Uses winsock2 and I built it with Mingw on Windows..

Building from source

Here is what I did:

1) To build the library; C:\hack\credis>gcc credis.c -shared -o credis.dll -Wl,--out-implib,libcredis.a -lws2_32 -LC:\MinGW\lib

2) To build the test program: gcc -o test.exe credis-test.c -L./ -lcredis

What I changed

1) Moved all Unix socket headers into one part, wrapped them in a #ifdef and introduced the Win32 socket header in another part.

2) All socket added WSADATA variable necessary for the Winsock initialization function WSAStartup.

3) closesocket for the Win32 code, instead of just cloes(2).

4) And now for the whammy; I copy pasted the BSD code for inet_aton for wireshark to make it work (hohohoho!)

A full patch is included in the tarball