Skip to content

Fix the 32-bit Windows build #731

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Fix the 32-bit Windows build #731

merged 1 commit into from
Sep 24, 2024

Conversation

hjyamauchi
Copy link
Contributor

Fix the windows build

Motivation:

https://ci-external.swift.org/job/swift-main-windows-toolchain/630/console

C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift-testing\Sources\_TestingInternals\Discovery.cpp(388,24): error: no matching function for call to 'min'
  388 |   DWORD hModuleCount = std::min(hModules.size(), byteCountNeeded / sizeof(HMODULE));
      |                        ^~~~~~~~
C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift-testing\Sources\_TestingInternals\Discovery.cpp(485,3): note: in instantiation of function template specialization 'enumerateTypeMetadataSections<(lambda at C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift-testing\Sources\_TestingInternals\Discovery.cpp:485:33)>' requested here
  485 |   enumerateTypeMetadataSections([=] (const void *imageAddress, const void *section, size_t size, bool *stop) {
      |   ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\utility(98,6): note: candidate template ignored: deduced conflicting types for parameter '_Ty' ('size_type' (aka 'unsigned int') vs. 'DWORD' (aka 'unsigned long'))
   98 |     (min) (const _Ty& _Left, const _Ty& _Right) noexcept(noexcept(_Right < _Left)) /* strengthened */ {
      |      ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xutility(6915,26): note: candidate template ignored: could not match 'initializer_list<_Ty>' against 'size_type' (aka 'unsigned int')
 6915 | _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist, _Pr _Pred) {
      |                          ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xutility(6922,26): note: candidate function template not viable: requires single argument '_Ilist', but 2 arguments were provided
 6922 | _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist) {
      |                          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\utility(88,33): note: candidate function template not viable: requires 3 arguments, but 2 were provided
   88 | _NODISCARD constexpr const _Ty&(min) (const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept(
      |                                 ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Modifications:

Add casts.

Result:

The windows build builds.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@stmontgomery
Copy link
Contributor

@swift-ci please test

Copy link
Contributor

@grynspan grynspan left a comment

Choose a reason for hiding this comment

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

Take a look at my proposed alternative. :)

@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

@hjyamauchi
Copy link
Contributor Author

Fixed. PTAL

@grynspan
Copy link
Contributor

Thanks!

@grynspan grynspan changed the title Fix the windows build Fix the 32-bit Windows build Sep 24, 2024
@grynspan grynspan added bug 🪲 Something isn't working windows 🪟 Windows support labels Sep 24, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Sep 24, 2024
@grynspan grynspan merged commit bfbae91 into swiftlang:main Sep 24, 2024
3 checks passed
@grynspan grynspan added the discovery 🔎 test content discovery label Mar 12, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🪲 Something isn't working discovery 🔎 test content discovery windows 🪟 Windows support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants