File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ if (BUILD_READERS)
105
105
src/Content.h
106
106
src/Content.cpp
107
107
src/DecodeHints.h
108
+ src/DecodeHints.cpp
108
109
src/DecoderResult.h
109
110
src/DetectorResult.h
110
111
src/Error.h
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2023 Axel Waggershauser
3
+ */
4
+ // SPDX-License-Identifier: Apache-2.0
5
+
6
+ #define HIDE_DECODE_HINTS_ALIAS
7
+
8
+ #include " ReadBarcode.h"
9
+
10
+ namespace ZXing {
11
+
12
+ // Provide a struct that is binary compatible with ReaderOptions and is actually called DecodeHints so that
13
+ // the compiler generates a correctly mangled pair of ReadBarcode(s) symbols to keep backward ABI compatibility.
14
+
15
+ struct DecodeHints
16
+ {
17
+ char data[sizeof (ReaderOptions)];
18
+ };
19
+
20
+ Result ReadBarcode (const ImageView& image, const DecodeHints& hints = {})
21
+ {
22
+ return ReadBarcode (image, reinterpret_cast <const ReaderOptions&>(hints));
23
+ }
24
+
25
+ Results ReadBarcodes (const ImageView& image, const DecodeHints& hints = {})
26
+ {
27
+ return ReadBarcodes (image, reinterpret_cast <const ReaderOptions&>(hints));
28
+ }
29
+
30
+ } // ZXing
Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ class ReaderOptions
172
172
bool hasFormat (BarcodeFormats f) const noexcept { return _formats.testFlags (f) || _formats.empty (); }
173
173
};
174
174
175
+ #ifndef HIDE_DECODE_HINTS_ALIAS
175
176
using DecodeHints [[deprecated]] = ReaderOptions;
177
+ #endif
176
178
177
179
} // ZXing
You can’t perform that action at this time.
0 commit comments