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

RenderWidget: Add include to Windows.h #10303

Merged
merged 1 commit into from Jan 1, 2022

Conversation

RA-Kooi
Copy link
Contributor

@RA-Kooi RA-Kooi commented Dec 27, 2021

Fixes errors when building with CMake (Ninja).
Currently it depends on PCH support, but it's broken currently.
Not depending on PCH is good practice anyway.

Not sure if Windows.h is the most lightweight include though, but it at least fixes the error of there not being a target defined.

@Pokechu22
Copy link
Contributor

The specific error:

9>RenderWidget.cpp
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(169,1): fatal error C1189: #error:  "No Target Architecture"
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(169,1): fatal error C1189: #error "No Target Architecture"
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(169,1): fatal error C1189: ^

According to this SO post you can just include windows.h on its own, and that includes windef.h. Note that Dolphin defines WIN32_LEAN_AND_MEAN so windows.h is much more lightweight.

As a related note, Dolphin seems to be inconsistent about specifying windows.h vs Windows.h (but that doesn't matter since Windows uses a case-insensitive filesystem; you can even use wInDoWs.H). The current inconsistency isn't something you need to deal with, and it's probably best to stick with Windows.h since that file also uses WinUser.h instead of winuser.h.

Source/Core/DolphinQt/RenderWidget.cpp Outdated Show resolved Hide resolved
Fixes errors when building with CMake. PCH support is currently broken,
however the code shouldn't have a hard dependency on PCH anyway.
@JosJuice JosJuice merged commit 85d2ea0 into dolphin-emu:master Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants