external/zxing/UnpackedTarball_zxing.mk   |    1 +
 external/zxing/msvc-lambdacapture.patch.0 |   11 +++++++++++
 2 files changed, 12 insertions(+)

New commits:
commit 29c2f382c8bb72106c76c134c705878fab30e2ad
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Dec 8 16:50:32 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Dec 9 17:50:03 2022 +0000

    external/zxing: Avoid MSVC 2022 error C2326
    
    > workdir/UnpackedTarball/zxing/core/src/qrcode/QRDetector.cpp(431): error 
C2326: 'auto ZXing::QRCode::SampleMQR::<lambda_1>::operator ()(int,bool) 
const': function cannot access 'FORMAT_INFO_COORDS'
    
    seen at least with VS 2022 17.4.2 and VS 2022 17.5.0 Preview 1.0, but not 
with
    VS 2019 16.11.21.  It looks to me like a bug in MSVC, but then again it 
doesn't
    hurt to make that variable static, anyway.
    
    Change-Id: I48fa22f9495791e60953f9f717ffc8333314de1c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143826
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 3f564769446032825b20ca6414caa1c196076ddc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143854
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/external/zxing/UnpackedTarball_zxing.mk 
b/external/zxing/UnpackedTarball_zxing.mk
index 0d81d13f6411..ac0aff061d72 100644
--- a/external/zxing/UnpackedTarball_zxing.mk
+++ b/external/zxing/UnpackedTarball_zxing.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,zxing, \
        external/zxing/assume.__cpp_lib_string_view.patch.0 \
        external/zxing/android_include.patch.0 \
        external/zxing/missing-include.patch.0 \
+       external/zxing/msvc-lambdacapture.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/zxing/msvc-lambdacapture.patch.0 
b/external/zxing/msvc-lambdacapture.patch.0
new file mode 100644
index 000000000000..390d1cc65502
--- /dev/null
+++ b/external/zxing/msvc-lambdacapture.patch.0
@@ -0,0 +1,11 @@
+--- core/src/qrcode/QRDetector.cpp
++++ core/src/qrcode/QRDetector.cpp
+@@ -418,7 +418,7 @@
+ 
+       auto srcQuad = Rectangle(7, 7, 0.5);
+ 
+-      constexpr PointI FORMAT_INFO_COORDS[] = {{0, 8}, {1, 8}, {2, 8}, {3, 
8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}, {8, 8},
++      static constexpr PointI FORMAT_INFO_COORDS[] = {{0, 8}, {1, 8}, {2, 8}, 
{3, 8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}, {8, 8},
+                                                                               
         {8, 7}, {8, 6}, {8, 5}, {8, 4}, {8, 3}, {8, 2}, {8, 1}, {8, 0}};
+ 
+       FormatInformation bestFI;

Reply via email to