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

Always define winversion #6863

Merged
merged 1 commit into from
Dec 15, 2023
Merged

Always define winversion #6863

merged 1 commit into from
Dec 15, 2023

Conversation

obligaron
Copy link
Contributor

@obligaron obligaron commented Dec 15, 2023

MSVC doesn't define Winversion automatically, but asio want it to be defined.

This avoids the following build output (technically it's not a warning) from asio:

Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).

@obligaron obligaron requested a review from glebm December 15, 2023 21:40
@@ -10,6 +10,8 @@ list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES
wininet
)

add_definitions(-DWINVER=0x0601 -D_WIN32_WINDOWS=0x0601 -D_WIN32_WINNT=0x0601)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We also do this in windows9x.cmake, hopefully this doesn't break it (don't see why it should)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When both (windows and windows9x) would be added, it would break. Only the first definition stays (at least in MSVC; I tested it).

That's why I changed Platforms.cmake to only include "windows.cmake" or "windows9x.cmake".
As far as I have seen "windows9x.cmake" includes everything that is also in "windows.cmake" + some windows 9x specific changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, makes sense, thanks!
These days treating windows 9x as a completely separate platform from modern Windows is sensible

@AJenbo AJenbo merged commit 4c7f60e into diasurgical:master Dec 15, 2023
19 checks passed
@obligaron obligaron deleted the defwindows branch December 16, 2023 07:32
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.

3 participants