Skip to content

Commit cdfe8cc

Browse files
committed
Fix C4266 warning
1 parent 2bc635f commit cdfe8cc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Auxiliary/DirectXTexEXR.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@
4545
#pragma warning(disable : 4244 4996)
4646
#include <ImfRgbaFile.h>
4747
#include <ImfIO.h>
48+
49+
// https://openexr.com/en/latest/PortingGuide.html
50+
#include <OpenEXRConfig.h>
4851
#pragma warning(pop)
4952

53+
#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + (100*OPENEXR_VERSION_MINOR) + OPENEXR_VERSION_PATCH)
54+
5055
#ifdef __clang__
5156
#pragma clang diagnostic pop
5257
#endif
@@ -148,6 +153,13 @@ namespace
148153
SetLastError(0);
149154
}
150155

156+
#if COMBINED_OPENEXR_VERSION >= 30300
157+
int64_t read(void *buf, uint64_t sz, uint64_t offset) override
158+
{
159+
return Imf::IStream::read(buf, sz, offset);
160+
}
161+
#endif
162+
151163
private:
152164
HANDLE m_hFile;
153165
LONGLONG m_EOF;

0 commit comments

Comments
 (0)