Skip to content

Commit 1aab1f3

Browse files
authored
Merge pull request #3490 from Konano:patch-4
Fix(wechat_code): Modify isnan for compatibility with -ffast_math. #3490 fix #3150 Merge with opencv/opencv#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
1 parent f5f4216 commit 1aab1f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/wechat_qrcode/src/zxing/zxing.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef __ZXING_ZXING_HPP__
1212
#define __ZXING_ZXING_HPP__
1313

14+
#include "opencv2/core/fast_math.hpp"
1415

1516
#define COUNTER_TYPE short
1617

@@ -54,8 +55,8 @@ typedef unsigned char boolean;
5455
#include <cmath>
5556

5657
namespace zxing {
57-
inline bool isnan(float v) { return std::isnan(v); }
58-
inline bool isnan(double v) { return std::isnan(v); }
58+
inline bool isnan(float v) { return (bool)cvIsNaN(v); }
59+
inline bool isnan(double v) { return (bool)cvIsNaN(v); }
5960
inline float nan() { return std::numeric_limits<float>::quiet_NaN(); }
6061
} // namespace zxing
6162

0 commit comments

Comments
 (0)