evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / en / ensemble-chorus / juice-cxx-packing-fix.diff
blob041f252a81e025d157bf11637590a13770a64c8e
1 diff --git a/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h b/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
2 index 69a66e4..3e50635 100644
3 --- a/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
4 +++ b/thirdparty/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
5 @@ -111,18 +111,10 @@ public:
6 forcedinline uint8 getGreen() const noexcept { return components.g; }
7 forcedinline uint8 getBlue() const noexcept { return components.b; }
9 - #if JUCE_GCC
10 - // NB these are here as a workaround because GCC refuses to bind to packed values.
11 - forcedinline uint8& getAlpha() noexcept { return comps [indexA]; }
12 - forcedinline uint8& getRed() noexcept { return comps [indexR]; }
13 - forcedinline uint8& getGreen() noexcept { return comps [indexG]; }
14 - forcedinline uint8& getBlue() noexcept { return comps [indexB]; }
15 - #else
16 forcedinline uint8& getAlpha() noexcept { return components.a; }
17 forcedinline uint8& getRed() noexcept { return components.r; }
18 forcedinline uint8& getGreen() noexcept { return components.g; }
19 forcedinline uint8& getBlue() noexcept { return components.b; }
20 - #endif
22 //==============================================================================
23 /** Copies another pixel colour over this one.
24 @@ -336,21 +328,22 @@ private:
25 uint8 b, g, r, a;
26 #endif
27 #endif
28 - } JUCE_PACKED;
29 + };
31 + // structure must be packed but using the packed attribute causes compile
32 + // failures with newer c++ compilers. Verify default packing produces same layout
33 + static_assert(sizeof(Components) == 4, "Components struct is not packed");
35 union
37 uint32 internal;
38 Components components;
39 - #if JUCE_GCC
40 - uint8 comps[4]; // helper struct needed because gcc does not allow references to packed union members
41 - #endif
44 -#ifndef DOXYGEN
45 - JUCE_PACKED
46 -#endif
48 +};
50 +// class must be packed but using the packed attribute causes compile
51 +// failures with newer c++ compilers. Verify default packing produces same layout
52 +static_assert(sizeof(PixelARGB) == 4, "PixelARGB class is not packed");
55 //==============================================================================