ports/graphics/krita/patches/patch-plugins_metadata_common_KisExiv2IODevice_h

72 lines
2.3 KiB
Text

From e7bf1f0d299c4f7c6529438059d14e7a99907066 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Sun, 4 Jun 2023 18:04:59 +0200
Subject: [PATCH] Fix build with exiv2 0.28
From 92a643544928c056a1192cd903e0c6666fd2f8c9 Mon Sep 17 00:00:00 2001
From: psykose -- <alice@ayaya.dev>
Date: Thu, 15 Jun 2023 08:48:43 +0000
Subject: [PATCH] KisExiv2IoDevice: fix types on 32-bit host with exiv2 0.28
Index: plugins/metadata/common/KisExiv2IODevice.h
--- plugins/metadata/common/KisExiv2IODevice.h.orig
+++ plugins/metadata/common/KisExiv2IODevice.h
@@ -18,34 +18,57 @@
class KRITAEXIFCOMMON_EXPORT KisExiv2IODevice : public Exiv2::BasicIo
{
public:
+#if EXIV2_TEST_VERSION(0,28,0)
+ using ptr_type = Exiv2::BasicIo::UniquePtr;
+#else
using ptr_type = Exiv2::BasicIo::AutoPtr;
+#endif
KisExiv2IODevice(QString path);
~KisExiv2IODevice() override;
int open() override;
int close() override;
+#if EXIV2_TEST_VERSION(0,28,0)
+ size_t write(const Exiv2::byte *data, size_t wcount) override;
+ size_t write(Exiv2::BasicIo &src) override;
+ int putb(Exiv2::byte data) override;
+ Exiv2::DataBuf read(size_t rcount) override;
+ size_t read(Exiv2::byte *buf, size_t rcount) override;
+#else
long write(const Exiv2::byte *data, long wcount) override;
long write(Exiv2::BasicIo &src) override;
int putb(Exiv2::byte data) override;
Exiv2::DataBuf read(long rcount) override;
long read(Exiv2::byte *buf, long rcount) override;
+#endif
int getb() override;
void transfer(BasicIo &src) override;
-#if defined(_MSC_VER)
+#if defined(__MSC_VERMSC_VER) || EXIV2_TEST_VERSION(0,28,0)
int seek(int64_t offset, Position pos) override;
#else
int seek(long offset, Position pos) override;
#endif
Exiv2::byte *mmap(bool isWriteable = false) override;
+#if EXIV2_TEST_VERSION(0,28,0)
+ void populateFakeData() override;
+#endif
int munmap() override;
+#if EXIV2_TEST_VERSION(0,28,0)
+ size_t tell() const override;
+#else
long tell() const override;
+#endif
size_t size() const override;
bool isopen() const override;
int error() const override;
bool eof() const override;
+#if EXIV2_TEST_VERSION(0,28,0)
+ const std::string& path() const noexcept override;
+#else
std::string path() const override;
+#endif
private:
bool open(QFile::OpenMode mode);