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.
This commit is contained in:
parent
2f8b3c45d3
commit
6c7a3aca3f
|
@ -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 },
|
||||
|
|
Loading…
Reference in a new issue