From afda967b07745c16d8c4a2a649a2709b0f8183e4 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Thu, 10 Aug 2023 09:43:06 +0200 Subject: [PATCH] Fix C linkage build error in CSparse --- doc/source/doxygen-docs/changelog.md | 3 ++- libs/math/include/mrpt/math/CSparseMatrix.h | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index 697d66f255..5fbdc117a7 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,7 +1,8 @@ \page changelog Change Log # Version 2.10.2: UNRELEASED -(No changes yet) +- BUG FIXES: + - Fix CSparse "C" linkage build error (OSX Clang) # Version 2.10.1: Released August 10th, 2023 - Build system: diff --git a/libs/math/include/mrpt/math/CSparseMatrix.h b/libs/math/include/mrpt/math/CSparseMatrix.h index 43609454e6..4d6467e369 100644 --- a/libs/math/include/mrpt/math/CSparseMatrix.h +++ b/libs/math/include/mrpt/math/CSparseMatrix.h @@ -19,18 +19,14 @@ #include // Include CSparse lib headers, either from the system or embedded: -extern "C" -{ #if MRPT_HAS_SUITESPARSE -#define NCOMPLEX // In MRPT we don't need complex numbers, so avoid the -// annoying warning: 'cs_ci_house' has C-linkage specified, -// but returns UDT 'std::complex' which is -// incompatible with C #include "cs.h" #else +extern "C" +{ #include -#endif } +#endif namespace mrpt::math {