From b1c8a4085319ff5433da3868c5784fbecb2c8f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 5 Mar 2023 18:16:06 +0100 Subject: [PATCH] Windows: Workaround missing DWRITE_FONT_WEIGHT value in old MinGW Fixes #74339. (cherry picked from commit b7ecb9584a1fc141d70140f6b0e573d870fa0dcb) --- SConstruct | 2 +- platform/windows/os_windows.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 2763f3f578f..8b39f120b4b 100644 --- a/SConstruct +++ b/SConstruct @@ -645,7 +645,7 @@ if selected_platform in platform_list: print( "Detected mingw version is not using posix threads. Only posix " "version of mingw is supported. " - 'Use "update-alternatives --config -w64-mingw32-[gcc|g++]" ' + 'Use "update-alternatives --config x86_64-w64-mingw32-g++" ' "to switch to posix threads." ) Exit(255) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 91d2d1e9965..6e219fb9299 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -69,6 +69,11 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; #define WM_POINTERUPDATE 0x0245 #endif +// Missing in MinGW headers before 8.0. +#ifndef DWRITE_FONT_WEIGHT_SEMI_LIGHT +#define DWRITE_FONT_WEIGHT_SEMI_LIGHT (DWRITE_FONT_WEIGHT)350 +#endif + #if defined(__GNUC__) // Workaround GCC warning from -Wcast-function-type. #define GetProcAddress (void *)GetProcAddress