Avoid non-self-contained Windows header #789

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:240119-windows changing 1 files +1 −1
  1. hebasto commented at 8:13 pm on January 19, 2024: member

    Using the windows.h header guarantees correctness regardless of the content of other headers.

    For more details, please refer to https://stackoverflow.com/questions/4845198/fatal-error-no-target-architecture-in-visual-studio

    Fixes the MSVC build when using the upcoming CMake-based build system and Qt packages installed via the vcpkg package manager.

    Related to https://github.com/hebasto/bitcoin/pull/77.

  2. DrahtBot commented at 8:13 pm on January 19, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theuni
    Stale ACK sipsorcery

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. hebasto cross-referenced this on Jan 19, 2024 from issue cmake: Build `bitcoin-qt` executable by hebasto
  4. hebasto added the label Windows on Jan 19, 2024
  5. hebasto commented at 8:14 pm on January 19, 2024: member
    Friendly ping @sipsorcery :)
  6. sipsorcery commented at 9:35 pm on January 19, 2024: member
    utACK c95767aa68e9e0e71e76884dbc83d237afdd7a37.
  7. theuni commented at 4:35 pm on January 22, 2024: contributor

    I don’t disagree with using self-contained headers, but according to your link it should only be necessary if we don’t define WIN32_LEAN_AND_MEAN, which we do.

    So, this makes me think there must be some compilation units where this somehow doesn’t get defined?

  8. hebasto commented at 4:37 pm on January 22, 2024: member

    So, this makes me think there must be some compilation units where this somehow doesn’t get defined?

    I suppose, they might be the qt* stuff built by vcpkg.

  9. hebasto commented at 5:17 pm on January 22, 2024: member

    @theuni

    You might be interested to consider the following example: https://godbolt.org/z/b8rns1e6x

  10. qt: Avoid non-self-contained Windows header
    Using the `windows.h` header guarantees correctness regardless of the
    content of other headers.
    For more details, please refer to https://stackoverflow.com/questions/4845198/fatal-error-no-target-architecture-in-visual-studio
    
    Fixes the MSVC build when using the upcoming CMake-based build system
    and Qt packages installed via the vcpkg package manager.
    8023640a71
  11. in src/qt/winshutdownmonitor.h:13 in c95767aa68 outdated
     9@@ -10,7 +10,7 @@
    10 #include <QString>
    11 #include <functional>
    12 
    13-#include <windef.h> // for HWND
    14+#include <windows.h> // for HWND
    


    fanquake commented at 10:10 am on January 23, 2024:
    Comment should be removed? We are removing these “for xyz” comments in any case, but this one would also now be incorrect.

    hebasto commented at 10:27 am on January 25, 2024:

    Comment should be removed?

    Thanks! Done.

  12. hebasto force-pushed on Jan 25, 2024
  13. theuni commented at 7:49 pm on January 26, 2024: contributor
    ACK 8023640a71a10ec54a6a8e6b95a29d07f7be218d. It’s not completely clear to me why this currently works, but I don’t think it’s worth wasting more time on. windows.h seems more correct regardless.
  14. DrahtBot requested review from sipsorcery on Jan 26, 2024
  15. hebasto merged this on Jan 26, 2024
  16. hebasto closed this on Jan 26, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-31 23:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me