From fbcfdb77a60ee3f74b9f9be4dcc1706233138277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 6 Jun 2024 18:05:48 +0200 Subject: [PATCH] Avoid including headers in extern "C" blocks --- CHOLMOD/GPU/cholmod_gpu_kernels.h | 4 ++-- ParU/Config/ParU.h.in | 8 ++++---- ParU/Include/ParU.h | 8 ++++---- ParU/Tcov/paru_c_test.cpp | 3 --- SPQR/Include/SuiteSparseQR.hpp | 11 +++++------ 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CHOLMOD/GPU/cholmod_gpu_kernels.h b/CHOLMOD/GPU/cholmod_gpu_kernels.h index c1708273bb..be7e687998 100644 --- a/CHOLMOD/GPU/cholmod_gpu_kernels.h +++ b/CHOLMOD/GPU/cholmod_gpu_kernels.h @@ -15,13 +15,13 @@ #ifndef CHOLMODGPUKERNELS_H #define CHOLMODGPUKERNELS_H +#include "SuiteSparse_config.h" + /* make it easy for C++ programs to include CHOLMOD */ #ifdef __cplusplus extern "C" { #endif -#include "SuiteSparse_config.h" - int createMapOnDevice ( int64_t *d_Map, int64_t *d_Ls, int64_t psi, int64_t nsrow ); int createRelativeMapOnDevice ( int64_t *d_Map, int64_t *d_Ls, diff --git a/ParU/Config/ParU.h.in b/ParU/Config/ParU.h.in index 5bfd634fd7..fca3942057 100644 --- a/ParU/Config/ParU.h.in +++ b/ParU/Config/ParU.h.in @@ -620,14 +620,14 @@ ParU_Info ParU_FreeControl // The following definitions are available in both C and C++: -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct ParU_C_Symbolic_struct *ParU_C_Symbolic ; typedef struct ParU_C_Numeric_struct *ParU_C_Numeric ; typedef struct ParU_C_Control_struct *ParU_C_Control ; diff --git a/ParU/Include/ParU.h b/ParU/Include/ParU.h index 6604878fbe..856721037d 100644 --- a/ParU/Include/ParU.h +++ b/ParU/Include/ParU.h @@ -620,14 +620,14 @@ ParU_Info ParU_FreeControl // The following definitions are available in both C and C++: -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct ParU_C_Symbolic_struct *ParU_C_Symbolic ; typedef struct ParU_C_Numeric_struct *ParU_C_Numeric ; typedef struct ParU_C_Control_struct *ParU_C_Control ; diff --git a/ParU/Tcov/paru_c_test.cpp b/ParU/Tcov/paru_c_test.cpp index d6fec407be..ca3a58e541 100644 --- a/ParU/Tcov/paru_c_test.cpp +++ b/ParU/Tcov/paru_c_test.cpp @@ -45,10 +45,7 @@ } #include "paru_cov.hpp" -extern "C" -{ #include "ParU.h" -} int main(int argc, char **argv) { diff --git a/SPQR/Include/SuiteSparseQR.hpp b/SPQR/Include/SuiteSparseQR.hpp index e4c6f14368..9cd7e8bfbe 100644 --- a/SPQR/Include/SuiteSparseQR.hpp +++ b/SPQR/Include/SuiteSparseQR.hpp @@ -18,12 +18,11 @@ #include #endif #define SUITESPARSE_GPU_EXTERN_ON -extern "C" -{ - #include "SuiteSparse_config.h" - #include "cholmod.h" - #include "SuiteSparseQR_definitions.h" -} + +#include "SuiteSparse_config.h" +#include "cholmod.h" +#include "SuiteSparseQR_definitions.h" + #undef SUITESPARSE_GPU_EXTERN_ON #include