Skip to content

[Support] [Windows] Stop redefining _WIN32_IE #102307

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

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

mstorsjo
Copy link
Member

@mstorsjo mstorsjo commented Aug 7, 2024

This was added in 181fd8c, where the shlobj.h header was taken into use. The shlobj.h header does have some APIs conditionally visible based on the _WIN32_IE define, but none of the calls added in that commit seem to need any specific version.

fd6cb64 and
6b129bd further bumped the version it is set to, while the latter also added a FIXME to check whether it still is needed.

It doesn't seem to be needed currently; the code currently builds fine without this define, both with mingw-w64 and MSVC.

Additionally, to show that the value of _WIN32_IE doesn't seem to be relevant to our builds these days - if the current define is changed to hardcode _WIN32_IE to an ancient value like 0x0400, our code still builds fine, both with mingw-w64 and MSVC. Therefore, overriding this define no longer seem to be relevant.

This was added in 181fd8c,
where the shlobj.h header was taken into use. The shlobj.h header
does have some APIs conditionally visible based on the _WIN32_IE
define, but none of the calls added in that commit seem to
need any specific version.

fd6cb64 and
6b129bd further bumped the
version it is set to, while the latter also added a FIXME to check
whether it still is needed.

It doesn't seem to be needed currently; the code currently builds
fine without this define, both with mingw-w64 and MSVC.

Additionally, to show that the value of _WIN32_IE doesn't seem
to be relevant to our builds these days - if the current define
is changed to hardcode _WIN32_IE to an ancient value like 0x0400,
our code still builds fine, both with mingw-w64 and MSVC. Therefore,
overriding this define no longer seem to be relevant.
@llvmbot
Copy link
Member

llvmbot commented Aug 7, 2024

@llvm/pr-subscribers-llvm-support

Author: Martin Storsjö (mstorsjo)

Changes

This was added in 181fd8c, where the shlobj.h header was taken into use. The shlobj.h header does have some APIs conditionally visible based on the _WIN32_IE define, but none of the calls added in that commit seem to need any specific version.

fd6cb64 and
6b129bd further bumped the version it is set to, while the latter also added a FIXME to check whether it still is needed.

It doesn't seem to be needed currently; the code currently builds fine without this define, both with mingw-w64 and MSVC.

Additionally, to show that the value of _WIN32_IE doesn't seem to be relevant to our builds these days - if the current define is changed to hardcode _WIN32_IE to an ancient value like 0x0400, our code still builds fine, both with mingw-w64 and MSVC. Therefore, overriding this define no longer seem to be relevant.


Full diff: https://github.com/llvm/llvm-project/pull/102307.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Support/Windows/WindowsSupport.h (-2)
diff --git a/llvm/include/llvm/Support/Windows/WindowsSupport.h b/llvm/include/llvm/Support/Windows/WindowsSupport.h
index d3aacd14b2097..6f5aae2485c52 100644
--- a/llvm/include/llvm/Support/Windows/WindowsSupport.h
+++ b/llvm/include/llvm/Support/Windows/WindowsSupport.h
@@ -23,11 +23,9 @@
 
 // mingw-w64 tends to define it as 0x0502 in its headers.
 #undef _WIN32_WINNT
-#undef _WIN32_IE
 
 // Require at least Windows 7 API.
 #define _WIN32_WINNT 0x0601
-#define _WIN32_IE    0x0800 // MinGW at it again. FIXME: verify if still needed.
 #define WIN32_LEAN_AND_MEAN
 #ifndef NOMINMAX
 #define NOMINMAX

Copy link
Contributor

@cjacek cjacek left a comment

Choose a reason for hiding this comment

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

FWIW, mingw-w64's sdkddkver.h should set it to the same value based on _WIN32_WINT, there should be no need to do that here (and, as you say, it'd be fine even if it didn't).

@mstorsjo mstorsjo merged commit 172ccfe into llvm:main Aug 7, 2024
9 checks passed
@mstorsjo mstorsjo deleted the win-remove-win32-ie branch August 7, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants