[ox] GBA fixes

This commit is contained in:
2023-02-03 21:56:30 -06:00
parent 535480ef26
commit b1b2780eb9
4 changed files with 17 additions and 2 deletions

View File

@ -93,7 +93,14 @@ Result<String> writeClawHeader(T *t, ClawFormat fmt) noexcept {
Result<Buffer> writeClaw(auto *t, ClawFormat fmt = ClawFormat::Metal) {
oxRequire(header, detail::writeClawHeader(t, fmt));
#ifdef OX_USE_STDLIB
oxRequire(data, fmt == ClawFormat::Metal ? writeMC(t) : writeOC(t));
#else
if (fmt != ClawFormat::Metal) {
return OxError(1, "OC is not supported in this build");
}
oxRequire(data, writeMC(t));
#endif
Buffer out(header.len() + data.size());
memcpy(out.data(), header.data(), header.len());
memcpy(out.data() + header.len(), data.data(), data.size());