From 6c7a3aca3f4bfaf62460aadf675705001734bb94 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 16 Sep 2020 01:50:07 +0000 Subject: [PATCH] Merged PR 5181334: OS build fixes on top of abf8805e0 til::color It turns out that clang/gcc are okay with the anonymous struct, but the CL we use in Windows was not. --- src/inc/til/color.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/inc/til/color.h b/src/inc/til/color.h index 347aae822e5..37025b26e6d 100644 --- a/src/inc/til/color.h +++ b/src/inc/til/color.h @@ -21,6 +21,9 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned" // Here, we leverage the spec-legality of using unions for type conversions and the // overlap of four uint8_ts and a uint32_t to make the conversion very obvious to // both compilers. +#pragma warning(push) + // CL will complain about the both nameless and anonymous struct. +#pragma warning(disable : 4201) union { struct @@ -33,6 +36,7 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned" }; uint32_t abgr; }; +#pragma warning(pop) constexpr color() noexcept : r{ 0 },