I need to write my own methods since those methods requires to include "Winsock2.h" and it's making me problems including it at different files, especially where at some places it's a template file with only .h file.

How can I write me own htons\htonl methods ??

Thanks.