Skip to content

Windows XP compatability fixes#1880

Merged
c-rack merged 1 commit intozeromq:masterfrom
MatthewPowley:fix-windows-xp-compatability
Mar 31, 2016
Merged

Windows XP compatability fixes#1880
c-rack merged 1 commit intozeromq:masterfrom
MatthewPowley:fix-windows-xp-compatability

Conversation

@MatthewPowley
Copy link
Contributor

A Visual Studio build from master (commit id: dac5b45) using the v140_xp toolset yields a binary that is not XP compatible.

Two libraries contain exports that cannot be found:

  • IPHLPAPI.DLL : if_nametoindex
  • KERNEL32.DLL : InitializeConditionVariable

The latter export is already dealt with in the file './src/condition_variable.hpp'; however this requires setting the _WIN32_WINNT pre-processor definition.
I am not experienced enough to figure a work around for the 'if_nametoindex' method, so I have created a new pre-processor definition 'ZMQ_HAVE_WINDOWS_TARGET_XP' and removed the calling of the function; with the limitation that these builds cannot handle a IPv6 address with an adapter name.

To make it easier for people targeting XP with an MSVC build I have modified the MSBuild property file to add/modify the pre-processor definitions if they are building using a XP targeting tool set; such as v140_xp.

I added a comment to the original commit that broke the compatability here: 7cfa933#commitcomment-16896696

I would appreciate a discussion on the suitability of the fix.

A Visual Studio build from master (commit id: dac5b45) using the v140_xp toolset yields a binary that is not XP compatible.

Two libraries contain exports that cannot be found:
 -  IPHLPAPI.DLL : if_nametoindex
 - KERNEL32.DLL : InitializeConditionVariable

The latter export is already dealt with in the file './src/condition_variable.hpp'; however this requires setting the _WIN32_WINNT pre-processor definition.
I am not experienced enough to figure a work around for the 'if_nametoindex' method, so I have created a new pre-processor definition 'ZMQ_HAVE_WINDOWS_TARGET_XP' and removed the calling of the function with the limitation that these builds cannot handle a IPv6 address with an adapter name.

To make it easier for people targeting XP with an MSVC build I have modified the MSBuild property file to add/modify the pre-processor definitions if they are building using a XP targeting tool set; such as v140_xp.
@MatthewPowley
Copy link
Contributor Author

Forgot to modify the tests. I will modify these if you think the fix is suitable.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 74.446% when pulling f2018ab on MatthewPowley:fix-windows-xp-compatability into dac5b45 on zeromq:master.

@c-rack c-rack merged commit a7922e5 into zeromq:master Mar 31, 2016
@MatthewPowley MatthewPowley deleted the fix-windows-xp-compatability branch April 1, 2016 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants