-
Notifications
You must be signed in to change notification settings - Fork 1k
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 C_ASSERT linkage conflicts when building with MinGW-w64 #332
base: main
Are you sure you want to change the base?
Conversation
@conorKotwasinski please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This PR fixes a compilation error that occurs when building Detours with MinGW-w64 toolchain. The issue arises from conflicting C_ASSERT declarations between ws2tcpip.h (C++ linkage) and detours.h (C linkage).
The fix moves C_ASSERT declarations out of the extern "C" block to preserve C++ linkage consistently. This allows Detours to compile successfully with MinGW-w64 while maintaining the same behavior.
Specifically:
This is important for projects using MinGW-w64 to build applications that depend on Detours, particularly when working with network-related functionality that requires ws2tcpip.h.
Before this change, attempting to build with MinGW-w64 would fail with:
conflicting declaration of 'void __C_ASSERT__(int*)' with 'C' linkage
The fix allows seamless integration while keeping the original verification logic intact.