From d48bf69f65444a13f8a34b8982b083c1b78fa0e8 Mon Sep 17 00:00:00 2001 From: Anushka Date: Tue, 7 Jul 2026 17:50:09 +0530 Subject: [PATCH] Merge pull request #29455 from anushkagupta200615-jpg:fix-issue-29452 Fix #29452: Remove to prevent _Complex macro conflicts #29455 ### 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. - [ ] The feature is well documented and sample code can be built with the project CMake --- **Description:** Resolves https://github.com/opencv/opencv/issues/29452 **Reason for the issue:** The C99 `` header defines the macro `complex` on some platforms (like NetBSD with GCC 14). Because it was included before C++ ``, this caused conflicts where `std::complex` was being expanded into `std::_Complex`, resulting in the reported syntax errors. **Changes made:** - Removed the unnecessary C-style `#include `. - Added a safety guard to `#undef complex` in case any transitive lapack headers attempt to define it, ensuring `std::complex` works cleanly without C-preprocessor interference. --- modules/core/src/hal_internal.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/core/src/hal_internal.cpp b/modules/core/src/hal_internal.cpp index d15cbb7ad3..029980db43 100644 --- a/modules/core/src/hal_internal.cpp +++ b/modules/core/src/hal_internal.cpp @@ -47,7 +47,6 @@ #ifdef HAVE_LAPACK -#include #include "opencv_lapack.h" #include @@ -710,4 +709,4 @@ int lapack_gemm64fc(const double *src1, size_t src1_step, const double *src2, si #pragma clang diagnostic pop #endif -#endif //HAVE_LAPACK \ No newline at end of file +#endif //HAVE_LAPACK