As I currently don't have a Windows build setup, I just tried to follow Microsofts own example here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms738520(v=vs.85).aspx

But I now realize that the undef probably should be before the two include statements above it. It, according to the documentation, has to do with string formatting (unicode or not). If it's defined the functions assumes that unicode is used, so this is just a precation in case it would be defined somewhere (probably not, so it could in theory be removed).

The pragma instructs the linker to link against Ws2_32.lib (DLL-file) where the getaddrinfo function resides. Again, based on the documentation.

What is your coding standard? I tried to keep the same formatting, but either my tool put in some of it's own stuff or I myself missed something. Are you referring to the space before "include"? In that case it's my misstake.