I think we should backpatch this till 9.5 as I could see the changes made by commit 0fb54de9 to support MSVC2015 are present in that branch and the same is mentioned in the commit message. Would you like to prepare patches (and test those) for back-branches?
I do not have means to test these patches using Visual Studio previous to 2012, but please find attached patches for 9.5-9.6 and 10-11-12 as of version 14. The extension is 'txt' not to break the cfbot.
I have made few cosmetic changes in the attached patch which includes adding/editing a few comments, ran pgindent, etc. I have replaced the reference of "IETF-standardized" with "Unix-style" as we are already using it at other places in the comments as well.