summarylogtreecommitdiffstats
path: root/010-libjxl-openexr-fix.patch
diff options
context:
space:
mode:
authorDaniel Bermond2021-06-02 18:29:08 +0000
committerDaniel Bermond2021-06-02 18:29:08 +0000
commit1e185ba12de31af6e52cefd10607ea40a13706d3 (patch)
treeb8cc46287828a2a2c532e083fcd99a47dd3b373e /010-libjxl-openexr-fix.patch
downloadaur-1e185ba12de31af6e52cefd10607ea40a13706d3.tar.gz
Initial commit
Package libjpeg-xl renamed to libjxl to follow the upstream name change.
Diffstat (limited to '010-libjxl-openexr-fix.patch')
-rw-r--r--010-libjxl-openexr-fix.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/010-libjxl-openexr-fix.patch b/010-libjxl-openexr-fix.patch
new file mode 100644
index 000000000000..a6d247958c1c
--- /dev/null
+++ b/010-libjxl-openexr-fix.patch
@@ -0,0 +1,37 @@
+--- a/lib/extras/codec_exr.cc
++++ b/lib/extras/codec_exr.cc
+@@ -32,6 +32,12 @@ namespace {
+ namespace OpenEXR = OPENEXR_IMF_NAMESPACE;
+ namespace Imath = IMATH_NAMESPACE;
+
++// OpenEXR::Int64 is deprecated in favor of using uint64_t directly, but using
++// uint64_t as recommended causes build failures with previous OpenEXR versions
++// on macOS, where the definition for OpenEXR::Int64 was actually not equivalent
++// to uint64_t. This alternative should work in all cases.
++using ExrInt64 = decltype(std::declval<OpenEXR::IStream>().tellg());
++
+ constexpr int kExrBitsPerSample = 16;
+ constexpr int kExrAlphaBits = 16;
+
+@@ -90,8 +96,8 @@ class InMemoryIStream : public OpenEXR::IStream {
+ return pos_ < bytes_.size();
+ }
+
+- OpenEXR::Int64 tellg() override { return pos_; }
+- void seekg(const OpenEXR::Int64 pos) override {
++ ExrInt64 tellg() override { return pos_; }
++ void seekg(const ExrInt64 pos) override {
+ JXL_ASSERT(pos + 1 <= bytes_.size());
+ pos_ = pos;
+ }
+@@ -115,8 +121,8 @@ class InMemoryOStream : public OpenEXR::OStream {
+ pos_ += n;
+ }
+
+- OpenEXR::Int64 tellp() override { return pos_; }
+- void seekp(const OpenEXR::Int64 pos) override {
++ ExrInt64 tellp() override { return pos_; }
++ void seekp(const ExrInt64 pos) override {
+ if (bytes_.size() + 1 < pos) {
+ bytes_.resize(pos - 1);
+ }