well,
the thing you wrote checks (unnessarily) for a double inclusion of winsock2.h because winsock2.h should define WINSOCK2.

What I wrote is to define _WINSOCK_ to make sure winsock.h is not include any more and make it possible to include winsock2.h afterwards and avoid the duplicate definition of structs and so on.

Check it out yourself ;-)