From 09a2c077ebab75b079383b0074e46001a3caef1b Mon Sep 17 00:00:00 2001 From: SColibri <100162546+SColibri@users.noreply.github.com> Date: Wed, 4 May 2022 23:39:03 +0200 Subject: [PATCH] windows.h defines DrawText and shadows the function Canvas.DrawText, fix based on the solution #70 (#394) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastian Carrion Ständer --- include/ftxui/dom/canvas.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ftxui/dom/canvas.hpp b/include/ftxui/dom/canvas.hpp index 02ed4a9..5ff5061 100644 --- a/include/ftxui/dom/canvas.hpp +++ b/include/ftxui/dom/canvas.hpp @@ -9,6 +9,12 @@ #include "ftxui/screen/color.hpp" // for Color #include "ftxui/screen/screen.hpp" // for Pixel +#ifdef DrawText +// Workaround for WinUsr.h (via Windows.h) defining macros that break things. +// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-drawtext +#undef DrawText +#endif + namespace ftxui { struct Canvas {