Besides of adapting the patch to the new avrdude_message()
system, the following things had to be modified:

. remove gratuitous whitespace changes (please don't touch
lines you are not working on)
. the result of the configure hook was not used anywhere
(#ifdef HAVE_LIBWS2_32)
. documentation update (removed old statement from avrdude.1
and avrdude.texi that stated the TCP feature being unavailable
on Win32)

I hope everything will work, I cannot test it myself.

Please test it as soon as possible, I'll leave the patch tracker
open so it can still collect feedback.

As a side note, currently, winsock2.h is included before avrdude.h, because it needs to be included before windows.h; I think this could be avoided if WIN32_LEAN_AND_MEAN was defined before windows.h is included in avrdude.h, but that would likely need to be changed across whole project.