Skip to content

Commit

Permalink
Merge pull request #3490 from Konano:patch-4
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Konano authored Sep 6, 2024
1 parent f5f4216 commit 1aab1f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/wechat_qrcode/src/zxing/zxing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#ifndef __ZXING_ZXING_HPP__
#define __ZXING_ZXING_HPP__

#include "opencv2/core/fast_math.hpp"

#define COUNTER_TYPE short

Expand Down Expand Up @@ -54,8 +55,8 @@ typedef unsigned char boolean;
#include <cmath>

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<float>::quiet_NaN(); }
} // namespace zxing

Expand Down

0 comments on commit 1aab1f3

Please sign in to comment.