Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configure failure on 32-bit MSVC. #64

Merged
merged 1 commit into from Sep 11, 2015

Conversation

a-martynovich
Copy link
Contributor

Windows libraries being checked (ws2_32, rpcrt4, iphlpapi) contain functions following stdcall convention. While on 64-bit platform it makes no difference, on 32-bit it does. For example, function WSAGetLastError is mangled by MSVC like "_WSAGetLastError@0". CMake checks if a function FUNC is present in a library by compiling a simple C source containing function definition "char FUNC()" and then calling it. Since stdcall functions are mangled in such a way that requires correct number of arguments (written after "@"), checking for a function with non-zero number of arguments will fail.
That is why we check for functions which have zero arguments and we also force stdcall convention.

Windows libraries being checked (ws2_32, rpcrt4, iphlpapi) contain functions following stdcall convention. While on 64-bit platform it makes no difference, on 32-bit it does. For example, function WSAGetLastError is mangled by MSVC like "_WSAGetLastError@0". CMake checks if a function FUNC is present in a library by compiling a simple C source containing function definition "char FUNC()" and then calling it. Since stdcall functions are mangled in such a way that requires correct number of arguments (written after "@"), checking for a function with non-zero number of arguments will fail.
That is why we check for functions which have zero arguments and we also force stdcall convention.
c-rack added a commit that referenced this pull request Sep 11, 2015
Fix configure failure on 32-bit MSVC.
@c-rack c-rack merged commit 549ee24 into zeromq:master Sep 11, 2015
@Kentzo Kentzo deleted the fix-msvc2015 branch December 18, 2015 06:59
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.

None yet

2 participants