1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Javascript: Update choc dependency

This commit is contained in:
Anthony Nicholls 2024-11-06 09:14:02 +00:00
parent 7bb11e4d61
commit 637226addc
3 changed files with 28 additions and 35 deletions

View file

@ -2323,7 +2323,7 @@ inline std::string_view ValueView::getString() const
// from this function
if (stringDictionary == nullptr)
throwError ("No string dictionary supplied");
return stringDictionary->getStringForHandle (getStringHandle());
}
@ -2430,43 +2430,28 @@ void ValueView::serialise (OutputStream& output) const
if (type.isVoid())
return;
auto dataSize = type.getValueDataSize();
check (dataSize > 0, "Invalid data size");
auto dataSize = type.getValueDataSize();
check (dataSize > 0, "Invalid data size");
if (stringDictionary == nullptr || ! type.usesStrings())
{
output.write (data, dataSize);
return;
}
if (stringDictionary == nullptr || ! type.usesStrings())
{
output.write (data, dataSize);
return;
}
uint8_t* localCopy = nullptr;
#if defined (_MSC_VER)
#pragma warning (push)
#pragma warning (disable: 6255)
auto* localCopy = (uint8_t*) _alloca (dataSize);
#pragma warning (pop)
#elif defined (__MINGW32__)
auto* localCopy = (uint8_t*) _alloca (dataSize);
#else
auto* localCopy = (uint8_t*) alloca (dataSize);
#endif
#if _MSC_VER
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wlanguage-extension-token"
#endif
__try
{
localCopy = (uint8_t*) _alloca (dataSize);
}
__except (GetExceptionCode() == STATUS_STACK_OVERFLOW)
{
throwError ("Stack overflow");
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#else
localCopy = (uint8_t*) alloca (dataSize);
#endif
check (localCopy != nullptr, "Stack allocation failed");
std::memcpy (localCopy, data, dataSize);
check (localCopy != nullptr, "Stack allocation failed");
std::memcpy (localCopy, data, dataSize);
static constexpr uint32_t maxStrings = 128;
uint32_t numStrings = 0, stringDataSize = 0;

View file

@ -100,7 +100,14 @@ inline Int128 multiply128 (uint64_t a, uint64_t b)
result.low = _umul128 (a, b, &result.high);
return result;
#elif __LP64__
#if __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
auto total = static_cast<unsigned __int128> (a) * static_cast<unsigned __int128> (b);
#if __GNUC__
#pragma GCC diagnostic pop
#endif
return { static_cast<uint64_t> (total >> 64), static_cast<uint64_t> (total) };
#else
uint64_t a0 = static_cast<uint32_t> (a), a1 = a >> 32,

View file

@ -75,6 +75,7 @@
#pragma GCC diagnostic ignored "-Wvolatile"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic ignored "-Wpedantic"
#ifndef __MINGW32__
#pragma GCC diagnostic ignored "-Wredundant-move"
#endif