diff -Nru qr-code-generator-1.7.0/debian/changelog qr-code-generator-1.7.0/debian/changelog --- qr-code-generator-1.7.0/debian/changelog 2022-01-02 10:52:31.000000000 +0000 +++ qr-code-generator-1.7.0/debian/changelog 2022-01-24 14:44:43.000000000 +0000 @@ -1,3 +1,9 @@ +qr-code-generator (1.7.0-2) unstable; urgency=medium + + * Fix ABI interface + + -- Yangfl Mon, 24 Jan 2022 22:44:43 +0800 + qr-code-generator (1.7.0-1) unstable; urgency=medium * New upstream release diff -Nru qr-code-generator-1.7.0/debian/patches/0001-Make-C-shared-lib.patch qr-code-generator-1.7.0/debian/patches/0001-Make-C-shared-lib.patch --- qr-code-generator-1.7.0/debian/patches/0001-Make-C-shared-lib.patch 2022-01-02 10:52:31.000000000 +0000 +++ qr-code-generator-1.7.0/debian/patches/0001-Make-C-shared-lib.patch 2022-01-24 14:44:43.000000000 +0000 @@ -1,4 +1,4 @@ -From 1abe33937f1cd561bf58a1f4475f8092a35566b8 Mon Sep 17 00:00:00 2001 +From ccfa51dc9cdf346bfb48fc8c97aceadd7e85a454 Mon Sep 17 00:00:00 2001 From: yangfl Date: Mon, 22 Feb 2021 00:13:09 +0800 Subject: [PATCH 1/2] Make C shared lib diff -Nru qr-code-generator-1.7.0/debian/patches/0002-Make-C-shared-lib.patch qr-code-generator-1.7.0/debian/patches/0002-Make-C-shared-lib.patch --- qr-code-generator-1.7.0/debian/patches/0002-Make-C-shared-lib.patch 2022-01-02 10:52:31.000000000 +0000 +++ qr-code-generator-1.7.0/debian/patches/0002-Make-C-shared-lib.patch 2022-01-24 14:44:43.000000000 +0000 @@ -1,15 +1,15 @@ -From b093e77fea0dcf1c96ca48df02ab4cb92db90824 Mon Sep 17 00:00:00 2001 +From 4a4bc0e4acf3c7394723b85c4345de45cf4ca430 Mon Sep 17 00:00:00 2001 From: yangfl Date: Mon, 22 Feb 2021 00:24:45 +0800 Subject: [PATCH 2/2] Make C++ shared lib --- - cpp/Makefile | 53 ++++++++++++++++++++++++++++++++----- - cpp/compat.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++ - cpp/qrcodegen.cpp | 2 ++ - cpp/qrcodegen.hpp | 18 +++++++++++++ - cpp/qrcodegencpp.pc.in | 10 +++++++ - 5 files changed, 136 insertions(+), 6 deletions(-) + cpp/Makefile | 53 ++++++++++++++++++++++++++++++++++----- + cpp/compat.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++ + cpp/qrcodegen.cpp | 4 ++- + cpp/qrcodegen.hpp | 26 ++++++++++++++++++- + cpp/qrcodegencpp.pc.in | 10 ++++++++ + 5 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 cpp/compat.cpp create mode 100644 cpp/qrcodegencpp.pc.in @@ -96,10 +96,10 @@ .deps/timestamp: diff --git a/cpp/compat.cpp b/cpp/compat.cpp new file mode 100644 -index 0000000..19144ca +index 0000000..b7a49e8 --- /dev/null +++ b/cpp/compat.cpp -@@ -0,0 +1,59 @@ +@@ -0,0 +1,57 @@ +#define QRCODEGEN_COMPAT + +#include @@ -112,7 +112,6 @@ +namespace qrcodegen { + +QrSegment::QrSegment(Mode md, int numCh, const std::vector &dt) : -+ mode(&compatMode), + compatMode(md), + numChars(numCh), + data(dt) { @@ -122,7 +121,6 @@ + + +QrSegment::QrSegment(Mode md, int numCh, std::vector &&dt) : -+ mode(&compatMode), + compatMode(md), + numChars(numCh), + data(std::move(dt)) { @@ -160,38 +158,55 @@ + +} diff --git a/cpp/qrcodegen.cpp b/cpp/qrcodegen.cpp -index e52dd50..bcd737c 100644 +index e52dd50..12348d2 100644 --- a/cpp/qrcodegen.cpp +++ b/cpp/qrcodegen.cpp -@@ -158,6 +158,7 @@ QrSegment QrSegment::makeEci(long assignVal) { +@@ -157,6 +157,7 @@ QrSegment QrSegment::makeEci(long assignVal) { + QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : ++ compatModeBits(-1), mode(&md), -+ compatMode(md), numChars(numCh), data(dt) { - if (numCh < 0) -@@ -167,6 +168,7 @@ QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : +@@ -166,6 +167,7 @@ QrSegment::QrSegment(const Mode &md, int numCh, const std::vector &dt) : + QrSegment::QrSegment(const Mode &md, int numCh, std::vector &&dt) : ++ compatModeBits(-1), mode(&md), -+ compatMode(md), numChars(numCh), data(std::move(dt)) { - if (numCh < 0) +@@ -211,7 +213,7 @@ bool QrSegment::isAlphanumeric(const char *text) { + + + const QrSegment::Mode &QrSegment::getMode() const { +- return *mode; ++ return compatModeBits < 0 ? *mode : compatMode; + } + + diff --git a/cpp/qrcodegen.hpp b/cpp/qrcodegen.hpp -index 9448982..1592028 100644 +index 9448982..1a5e4f7 100644 --- a/cpp/qrcodegen.hpp +++ b/cpp/qrcodegen.hpp -@@ -152,6 +152,7 @@ class QrSegment final { +@@ -151,7 +151,14 @@ class QrSegment final { + /*---- Instance fields ----*/ /* The mode indicator of this segment. Accessed through getMode(). */ - private: const Mode *mode; -+ private: Mode compatMode; +- private: const Mode *mode; ++ private: union { ++ struct { ++ // < 0, mode is valid ++ int compatModeBits; ++ const Mode *mode; ++ }; ++ Mode compatMode; ++ }; /* The length of this segment's unencoded data. Measured in characters for * numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. -@@ -170,7 +171,11 @@ class QrSegment final { +@@ -170,7 +177,11 @@ class QrSegment final { * The character count (numCh) must agree with the mode and the bit buffer length, * but the constraint isn't checked. The given bit buffer is copied and stored. */ @@ -203,7 +218,7 @@ /* -@@ -178,7 +183,11 @@ class QrSegment final { +@@ -178,7 +189,11 @@ class QrSegment final { * The character count (numCh) must agree with the mode and the bit buffer length, * but the constraint isn't checked. The given bit buffer is moved and stored. */ @@ -215,7 +230,7 @@ /*---- Methods ----*/ -@@ -369,6 +378,15 @@ class QrCode final { +@@ -369,6 +384,15 @@ class QrCode final { public: bool getModule(int x, int y) const;