diff --git a/CXSparse/Config/cs.h.in b/CXSparse/Config/cs.h.in index e73488a3d..6280e7467 100644 --- a/CXSparse/Config/cs.h.in +++ b/CXSparse/Config/cs.h.in @@ -27,12 +27,12 @@ #define _CXS_H #if @CXSPARSE_USE_COMPLEX@ -#include -#define cs_complex_t double _Complex -#endif - -#ifdef __cplusplus -extern "C" { +# ifdef __cplusplus +# include +# else +# include +# endif +# define cs_complex_t double _Complex #endif #define CS_VER @CXSPARSE_VERSION_MAJOR@ /* CXSparse Version */ @@ -47,6 +47,10 @@ extern "C" { #define cs_long_t_id "%" PRId64 #define cs_long_t_max INT64_MAX +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------------------------------------------------------------- */ /* double/int32_t version of CXSparse */ /* -------------------------------------------------------------------------- */ diff --git a/CXSparse/Include/cs.h b/CXSparse/Include/cs.h index 5a083f82c..e1cf17f04 100644 --- a/CXSparse/Include/cs.h +++ b/CXSparse/Include/cs.h @@ -27,12 +27,12 @@ #define _CXS_H #if 1 -#include -#define cs_complex_t double _Complex -#endif - -#ifdef __cplusplus -extern "C" { +# ifdef __cplusplus +# include +# else +# include +# endif +# define cs_complex_t double _Complex #endif #define CS_VER 4 /* CXSparse Version */ @@ -47,6 +47,10 @@ extern "C" { #define cs_long_t_id "%" PRId64 #define cs_long_t_max INT64_MAX +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------------------------------------------------------------- */ /* double/int32_t version of CXSparse */ /* -------------------------------------------------------------------------- */