From 0a9a72cbaa7a063d4efbef7175f0808cf674b059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Lind=C3=A9n?= Date: Tue, 9 Feb 2021 14:18:29 +0100 Subject: [PATCH] Workaround Windows.h breaking the Color::RGB function (#70) wingdi.h (included via Windows.h) defines an RGB macro that breaks things. If a user really wants that macro in the same file as FTXUI they can move the Windows.h include to after the inclusion of FTXUI's headers. --- include/ftxui/screen/color.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ftxui/screen/color.hpp b/include/ftxui/screen/color.hpp index 84bd936..6bb0c19 100644 --- a/include/ftxui/screen/color.hpp +++ b/include/ftxui/screen/color.hpp @@ -4,6 +4,12 @@ #include #include +#ifdef RGB +// Workaround for wingdi.h (via Windows.h) defining macros that break things. +// https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-rgb +#undef RGB +#endif + namespace ftxui { /// @brief A class representing terminal colors.