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

Define WINBOOL on non-MinGW platforms #52

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Define WINBOOL on non-MinGW platforms #52

merged 1 commit into from
Sep 17, 2024

Conversation

qmfrederik
Copy link
Contributor

@qmfrederik qmfrederik commented Sep 17, 2024

The Windows SDK declares BOOL as an int. Objective C defines BOOL as a char. Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL type to avoid this clash. When compiling natively on Windows, we need to manually define WINBOOL.
MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick here.
See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355

The Windows SDK declares BOOL as an int.  Objective C defines BOOl as a char.
Those two types clash.  MinGW's implementation of the Windows SDK uses the WINBOOL
type to avoid this clash.  When compiling natively on Windows, we need to manually
define WINBOOL.
MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
here.
See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
@qmfrederik
Copy link
Contributor Author

This could also go in a separate header file; open for suggestions.

Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks strange to have this scattered in three files but out of the top of my head I cannot come up with a better place.

@fredkiefer fredkiefer merged commit ba1c582 into master Sep 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants