diff --git a/deps/ox/src/ox/mc/read.cpp b/deps/ox/src/ox/mc/read.cpp index 303087c8..d52b3755 100644 --- a/deps/ox/src/ox/mc/read.cpp +++ b/deps/ox/src/ox/mc/read.cpp @@ -6,6 +6,14 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include +#include +#include + +#include "read.hpp" + namespace ox { +template class ModelHandlerInterface>; + } diff --git a/deps/ox/src/ox/mc/read.hpp b/deps/ox/src/ox/mc/read.hpp index 8e38a824..f6252e7a 100644 --- a/deps/ox/src/ox/mc/read.hpp +++ b/deps/ox/src/ox/mc/read.hpp @@ -549,4 +549,6 @@ Result readMC(const Buffer &buff) noexcept { return readMC(buff.data(), buff.size()); } +extern template class ModelHandlerInterface>; + } diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index edb7a568..f5a6d51b 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -359,15 +359,19 @@ constexpr Error MetalClawWriter::field(const char*, const HashMap ox::Error { const auto keyLen = ox_strlen(key); auto wkey = ox_malloca(keyLen + 1, char, 0); memcpy(wkey, key.c_str(), keyLen + 1); oxReturnError(handler.fieldCString("", wkey.get(), keyLen)); - oxRequireM(value, val->at(key)); - oxReturnError(handler.field("", value)); + oxRequireM(value, val.at(key)); + return handler.field("", value); + }; + // write the array + for (std::size_t i = 0; i < len; i++) { + auto const&key = keys[i]; + oxReturnError(loopBody(handler, key, *val)); } oxReturnError(writer.finalize()); fieldSet = true;