--- modules/jsonreader/SkJSONReader.h.orig 2026-04-26 19:40:19.655385534 +0000 +++ modules/jsonreader/SkJSONReader.h 2026-04-26 19:40:38.990897251 +0000 @@ -145,6 +145,7 @@ void init_tagged(Tag); void init_tagged_pointer(Tag, void*); +#if defined(SK_CPU_LENDIAN) Tag getTag() const { return static_cast(fData8[0] & kTagMask); } @@ -189,6 +190,19 @@ ? reinterpret_cast(this) + 0 // need all the bits : reinterpret_cast(this) + 1; // skip the first word (where the tag lives) } +#else // SK_CPU_BENDIAN + Tag getTag() const { + return static_cast(fData8[kValueSize-1] & kTagMask); + } + + template + const T* cast() const { + static_assert(sizeof (T) <= sizeof(Value), ""); + static_assert(alignof(T) <= alignof(Value), ""); + + return reinterpret_cast(this); + } +#endif template T* cast() { return const_cast(const_cast(this)->cast()); } @@ -210,11 +224,6 @@ inline static constexpr size_t kValueSize = 8; uint8_t fData8[kValueSize]; - -#if !defined(SK_CPU_LENDIAN) - // The current value layout assumes LE and will take some tweaking for BE. - static_assert(false, "Big-endian builds are not supported at this time."); -#endif }; class NullValue final : public Value {