Skip to content

Commit

Permalink
Merged PR 5181334: OS build fixes on top of abf8805
Browse files Browse the repository at this point in the history
til::color
It turns out that clang/gcc are okay with the anonymous
struct, but the CL we use in Windows was not.
  • Loading branch information
DHowett committed Sep 16, 2020
1 parent 2f8b3c4 commit 6c7a3ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/inc/til/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +36,7 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
};
uint32_t abgr;
};
#pragma warning(pop)

constexpr color() noexcept :
r{ 0 },
Expand Down

0 comments on commit 6c7a3ac

Please sign in to comment.