Skip to content

Commit da1fca6

Browse files
committed
Fix crash in release build with llvm-mingw.
1 parent e5ccaa7 commit da1fca6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

platform/windows/detect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def spawn_capture(sh, escape, cmd, args, env):
405405

406406
if env["accesskit"]:
407407
if int(env["target_win_version"], 16) < 0x0602:
408-
print_info("AcceeKit enabled, targeted Windows version changed to Windows 8 (0x602).")
408+
print_info("AccessKit enabled, targeted Windows version changed to Windows 8 (0x602).")
409409
env["target_win_version"] = "0x0602" # Accessibility API require Windows 8+
410410

411411
env.AppendUnique(
@@ -771,7 +771,7 @@ def configure_mingw(env: "SConsEnvironment"):
771771

772772
if env["accesskit"]:
773773
if int(env["target_win_version"], 16) < 0x0602:
774-
print_info("AcceeKit enabled, targeted Windows version changed to Windows 8 (0x602).")
774+
print_info("AccessKit enabled, targeted Windows version changed to Windows 8 (0x602).")
775775
env["target_win_version"] = "0x0602" # Accessibility API require Windows 8+
776776

777777
if not env["use_llvm"]:

platform/windows/display_server_windows.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,23 +2790,23 @@ int DisplayServerWindows::accessibility_should_increase_contrast() const {
27902790
}
27912791

27922792
int DisplayServerWindows::accessibility_should_reduce_animation() const {
2793-
bool anim_enabled = false;
2793+
BOOL anim_enabled = false; // Note: this should be BOOL (WinAPI), not bool (C++), since SystemParametersInfoA expect variable with specific size.
27942794
if (!SystemParametersInfoA(SPI_GETCLIENTAREAANIMATION, 0, &anim_enabled, 0)) {
27952795
return -1;
27962796
}
27972797
return (!anim_enabled);
27982798
}
27992799

28002800
int DisplayServerWindows::accessibility_should_reduce_transparency() const {
2801-
bool tr_enabled = false;
2801+
BOOL tr_enabled = false; // Note: this should be BOOL (WinAPI), not bool (C++), since SystemParametersInfoA expect variable with specific size.
28022802
if (!SystemParametersInfoA(SPI_GETDISABLEOVERLAPPEDCONTENT, 0, &tr_enabled, 0)) {
28032803
return -1;
28042804
}
28052805
return tr_enabled;
28062806
}
28072807

28082808
int DisplayServerWindows::accessibility_screen_reader_active() const {
2809-
bool sr_enabled = false;
2809+
BOOL sr_enabled = false; // Note: this should be BOOL (WinAPI), not bool (C++), since SystemParametersInfoA expect variable with specific size.
28102810
if (SystemParametersInfoA(SPI_GETSCREENREADER, 0, &sr_enabled, 0) && sr_enabled) {
28112811
return true;
28122812
}
@@ -7208,6 +7208,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
72087208

72097209
windows[MAIN_WINDOW_ID].initialized = true;
72107210

7211+
#ifdef ACCESSKIT_ENABLED
72117212
if (accessibility_screen_reader_active()) {
72127213
_THREAD_SAFE_LOCK_
72137214
uint64_t time_wait = OS::get_singleton()->get_ticks_msec();
@@ -7225,6 +7226,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
72257226
}
72267227
_THREAD_SAFE_UNLOCK_
72277228
}
7229+
#endif
72287230

72297231
#if defined(RD_ENABLED)
72307232
if (rendering_context) {

0 commit comments

Comments
 (0)