This workaround (those extra defines needed and extra implementations) only applies to XP, at least with mingw. For Win7 mingw is fine without them, so I'll start by putting in a test for XP. I'll also see how the Windows SDK handles this case on XP.
With this patch, passes all tests (except the reuseaddr one, but that applies to all platforms I've tested)
Not pretty, but we're coping with an old OS with patched-on IPV6 here ;)