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 Windows Build #10

Merged
merged 5 commits into from
Aug 19, 2024
Merged

Fix Windows Build #10

merged 5 commits into from
Aug 19, 2024

Conversation

HTRamsey
Copy link
Contributor

@HTRamsey HTRamsey commented Aug 8, 2024

Fixes a couple of windows issues

Edit: CMake should be updated too (like the compile options) but it shouldn't affect using this as a submodule since MAIN_PROJECT would be false

Fix portability of vector iterator
Fix Windows Check
@HTRamsey HTRamsey changed the title Update messages.cpp Fix Windows Build Aug 8, 2024
Import windows for target architecture
Fix casting to HANDLE
@bkueng
Copy link
Member

bkueng commented Aug 9, 2024

There's a minor style issue, otherwise good to merge (https://github.com/PX4/ulog_cpp/actions/runs/10309113259/job/28554831362?pr=10).

@HTRamsey
Copy link
Contributor Author

HTRamsey commented Aug 9, 2024

So based on this (https://stackoverflow.com/questions/4845198/fatal-error-no-target-architecture-in-visual-studio) windows.h needs to be included first otherwise I get "No Target Architecture". But maybe we just use a different method to define it, like this?

#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
#define _AMD64_
#elif defined(i386) || defined(__i386) || defined(__i386__) || defined(__i386__) || defined(_M_IX86)
#define _X86_
#elif defined(__arm__) || defined(_M_ARM) || defined(_M_ARMT)
#define _ARM_
#endif

Probably this wouldn't happen when using this as a submodule, just when using the tests directly.

@bkueng
Copy link
Member

bkueng commented Aug 12, 2024

Ah ok, then let's just ignore it with // NOLINT or // NOLINTBEGIN / // NOLINTEND

@bkueng bkueng merged commit 70c8256 into PX4:windows Aug 19, 2024
1 of 2 checks passed
bkueng pushed a commit that referenced this pull request Aug 19, 2024
- Fix portability of vector iterator
- Fix casting to HANDLE
bkueng pushed a commit that referenced this pull request Aug 19, 2024
- Fix portability of vector iterator
- Fix casting to HANDLE
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.

2 participants