libstrat: fix compilation without pre-compiled header/without lto

This commit is contained in:
Michael Scire 2021-10-06 17:58:42 -07:00
parent 7ca83c9d3b
commit e8f1efd01b
37 changed files with 89 additions and 33 deletions

View file

@ -98,11 +98,13 @@ namespace ams::fs {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
/* TODO: Better result? Is it possible to get a more specific one? */
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedOperation();
}
virtual Result SetSize(s64 size) override {
/* TODO: Better result? Is it possible to get a more specific one? */
AMS_UNUSED(size);
return fs::ResultUnsupportedOperation();
}
};

View file

@ -63,10 +63,13 @@ namespace ams::fs {
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInMemoryStorageA();
}
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
AMS_UNUSED(offset, size, src, src_size);
switch (op_id) {
case OperationId::Invalidate:
return ResultSuccess();

View file

@ -46,10 +46,12 @@ namespace ams::fs {
}
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override final {
AMS_UNUSED(offset, buffer, size, option);
return fs::ResultUnsupportedOperationInReadOnlyFileA();
}
virtual Result DoSetSize(s64 size) override final {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInReadOnlyFileA();
}

View file

@ -53,6 +53,8 @@ namespace ams::fs {
}
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override final {
AMS_UNUSED(src, src_size);
R_UNLESS(op_id == OperationId::QueryRange, fs::ResultUnsupportedOperationInFileServiceObjectAdapterA());
R_UNLESS(dst_size == sizeof(FileQueryRangeInfo), fs::ResultInvalidSize());

View file

@ -53,6 +53,7 @@ namespace ams::fs {
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
/* TODO: How to deal with this? */
AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size);
return fs::ResultUnsupportedOperation();
};
};

View file

@ -84,6 +84,8 @@ namespace ams::fs::fsa {
virtual sf::cmif::DomainObjectId GetDomainObjectId() const = 0;
protected:
Result DryRead(size_t *out, s64 offset, size_t size, const fs::ReadOption &option, OpenMode open_mode) {
AMS_UNUSED(option);
/* Check that we can read. */
R_UNLESS((open_mode & OpenMode_Read) != 0, fs::ResultReadNotPermitted());
@ -101,11 +103,14 @@ namespace ams::fs::fsa {
R_UNLESS((open_mode & OpenMode_Write) != 0, fs::ResultWriteNotPermitted());
AMS_ASSERT(size >= 0);
AMS_UNUSED(size);
return ResultSuccess();
}
Result DryWrite(bool *out_append, s64 offset, size_t size, const fs::WriteOption &option, fs::OpenMode open_mode) {
AMS_UNUSED(option);
/* Check that we can write. */
R_UNLESS((open_mode & OpenMode_Write) != 0, fs::ResultWriteNotPermitted());

View file

@ -159,25 +159,30 @@ namespace ams::fs::fsa {
virtual Result DoCommit() = 0;
virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
virtual Result DoCleanDirectoryRecursively(const char *path) = 0;
virtual Result DoGetFileTimeStampRaw(fs::FileTimeStampRaw *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
virtual Result DoQueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, fs::fsa::QueryId query, const char *path) {
AMS_UNUSED(dst, dst_size, src, src_size, query, path);
return fs::ResultNotImplemented();
}
/* These aren't accessible as commands. */
virtual Result DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultNotImplemented();
}

View file

@ -25,6 +25,7 @@ namespace ams::fs::impl {
}
static ALWAYS_INLINE void *operator new(size_t size, Newable *placement) noexcept {
AMS_UNUSED(size);
return placement;
}