Merge pull request #29 from mloskot/msvc-port

Add missing casts from void* and replace #if HAVE_X with #ifdef HAVE_X