Windows port

Hi, below is a patch for windows. Please review. :)

BTW, I noticed some bugs which is non-free, overrun, broken pointer. I prefer to use golang instead of C. Go don't need dependency shared libraries,  have GC, portability, many useful libraries. How about to replace to go?