ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.22k stars 935 forks source link

Use the correct modern windows sockets header #1124

Closed hamishcoleman closed 1 year ago

hamishcoleman commented 1 year ago

As suggested in a PR from @Legend-Master (this change is basically unrelated to the main point of his PR, so extracted here)

Windows is a confusing and disappointing development environment. They completely replaced all the definitions in winsock.h with exact equivalents in winsock2.h (except for a small number of deprecated functions).

However they didnt make them mutually exclusive - so if you include both, you get errors. They also automatically include winsock.h from windows.h, so you must remember to include winsock2.h first. They also didnt just remove winsock.h and replace it with the new contents.

(Probably in the name of "compatibility", whilst swearing that the new winsock is the same as the old one - because if you cannot believe two inconsistent things simultaneously, you shouldnt be a windows programmer)

All these things are totally nuts. Thanks, windows dev environment, for not noticing that this is nuts