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

Assume WIN32 HINSTANCE is a void * #230

Merged
merged 1 commit into from
Apr 9, 2020
Merged

Assume WIN32 HINSTANCE is a void * #230

merged 1 commit into from
Apr 9, 2020

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Apr 9, 2020

According to MSDN, HINSTANCE is a HANDLE is a PVOID is a void * everywhere on Windows. If we assume this, we can drop the problematic Windows.h include from our header and contain it to a single source file.

I included a sanity check that will break if this assumption is ever broken.

Alternative to #229
Inspired by ros2/geometry2#247

@cottsay cottsay self-assigned this Apr 9, 2020
@cottsay
Copy link
Member Author

cottsay commented Apr 9, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@cottsay cottsay added the bug Something isn't working label Apr 9, 2020
According to MSDN, `HINSTANCE` is a `HANDLE` is a `PVOID` is a `void *`
everywhere on Windows. If we assume this, we can drop the problematic
Windows.h include from our header and contain it to a single source
file.

I included a sanity check that will break if this assumption is ever
broken.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay
Copy link
Member Author

cottsay commented Apr 9, 2020

The Windows test failures were appearing on nightly builds a few days ago, so I don't believe that this change regressed them.
Since tests look good on all 4 platforms, I'm going to merge this in.

@cottsay cottsay merged commit a6306c6 into master Apr 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the remove_windows_h branch April 9, 2020 22:18
jacobperron added a commit that referenced this pull request Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants