From 1aab1f34815a58a5a63aee6d510fe234129754a2 Mon Sep 17 00:00:00 2001 From: Nano Date: Fri, 6 Sep 2024 13:15:24 +0800 Subject: [PATCH] Merge pull request #3490 from Konano:patch-4 Fix(wechat_code): Modify isnan for compatibility with -ffast_math. #3490 fix #3150 Merge with https://github.com/opencv/opencv/pull/23881 Reference: https://stackoverflow.com/questions/7263404/mingw32-stdisnan-with-ffast-math ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/wechat_qrcode/src/zxing/zxing.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/wechat_qrcode/src/zxing/zxing.hpp b/modules/wechat_qrcode/src/zxing/zxing.hpp index 76efae22c..d735c830f 100644 --- a/modules/wechat_qrcode/src/zxing/zxing.hpp +++ b/modules/wechat_qrcode/src/zxing/zxing.hpp @@ -11,6 +11,7 @@ #ifndef __ZXING_ZXING_HPP__ #define __ZXING_ZXING_HPP__ +#include "opencv2/core/fast_math.hpp" #define COUNTER_TYPE short @@ -54,8 +55,8 @@ typedef unsigned char boolean; #include namespace zxing { -inline bool isnan(float v) { return std::isnan(v); } -inline bool isnan(double v) { return std::isnan(v); } +inline bool isnan(float v) { return (bool)cvIsNaN(v); } +inline bool isnan(double v) { return (bool)cvIsNaN(v); } inline float nan() { return std::numeric_limits::quiet_NaN(); } } // namespace zxing