From 4daf461f5a59ba297b0da67864ea39a443fc549e Mon Sep 17 00:00:00 2001 From: Simon Smart Date: Tue, 12 Mar 2024 22:08:29 +0000 Subject: [PATCH] ODB-554: Workaround for weird compiler bug in clang 14.0.3 on MacOS 13 --- src/odc/api/odc.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/odc/api/odc.cc b/src/odc/api/odc.cc index d8ba3126..14a26d59 100644 --- a/src/odc/api/odc.cc +++ b/src/odc/api/odc.cc @@ -308,7 +308,9 @@ int odc_open_stream(odc_reader_t** reader, void* handle, odc_stream_read_t strea ReadStreamDataHandle(void* handle, odc_stream_read_t fn) : handle_(handle), fn_(fn) {} virtual ~ReadStreamDataHandle() {} void print(std::ostream& s) const override { s << "StreamReadHandle(" << fn_ << "(" << handle_ << "))"; } - Length openForRead() override { return 0; } + // Hack for compiler bug on clang-14.0.3 running on MacOS 13 + static Length workaroundFunction() { return 0; } + Length openForRead() override { return workaroundFunction(); } void openForWrite(const Length&) override { NOTIMP; } void openForAppend(const Length&) override { NOTIMP; } long read(void* buffer, long length) override { return fn_(handle_, buffer, length); }