File: 0007-resvg-qt-Check-Qt-version-before-using-modern-API.patch

package info (click to toggle)
resvg 0.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,924 kB
  • sloc: cpp: 2,398; python: 107; makefile: 81; ansic: 76; sh: 15
file content (24 lines) | stat: -rw-r--r-- 797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Evgeniy Reizner <razrfalcon@gmail.com>
Date: Mon, 23 Dec 2019 01:25:41 +0200
Subject: (resvg-qt) Check Qt version before using modern API.

---
 bindings/resvg-qt/cpp/qt_capi.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bindings/resvg-qt/cpp/qt_capi.cpp b/bindings/resvg-qt/cpp/qt_capi.cpp
index 1b63aba..cabda9d 100644
--- a/bindings/resvg-qt/cpp/qt_capi.cpp
+++ b/bindings/resvg-qt/cpp/qt_capi.cpp
@@ -48,7 +48,11 @@ uint8_t* qtc_qimage_get_data(qtc_qimage *c_img)
 
 uint32_t qtc_qimage_get_size_in_bytes(qtc_qimage *c_img)
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
     return IMAGE_CAST->sizeInBytes();
+#else
+    return IMAGE_CAST->byteCount();
+#endif
 }
 
 qtc_qimage* qtc_qimage_resize(qtc_qimage *c_img, uint32_t width, uint32_t height, AspectRatioMode ratio,