Since sockwrap.h #Includes winsock2.h, let's #include it before any other header files (e.g. genwrap.h)