Skip to content

Commit

Permalink
Merge pull request #351 from mmuetzel/cxsparse
Browse files Browse the repository at this point in the history
CXSparse: Avoid including C header in C++ code
  • Loading branch information
DrTimothyAldenDavis authored Aug 14, 2023
2 parents 4320982 + 19b13ea commit 1796b78
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 10 additions & 6 deletions CXSparse/Config/cs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#define _CXS_H

#if @CXSPARSE_USE_COMPLEX@
#include <complex.h>
#define cs_complex_t double _Complex
#endif

#ifdef __cplusplus
extern "C" {
# ifdef __cplusplus
# include <complex>
# else
# include <complex.h>
# endif
# define cs_complex_t double _Complex
#endif

#define CS_VER @CXSPARSE_VERSION_MAJOR@ /* CXSparse Version */
Expand All @@ -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 */
/* -------------------------------------------------------------------------- */
Expand Down
16 changes: 10 additions & 6 deletions CXSparse/Include/cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#define _CXS_H

#if 1
#include <complex.h>
#define cs_complex_t double _Complex
#endif

#ifdef __cplusplus
extern "C" {
# ifdef __cplusplus
# include <complex>
# else
# include <complex.h>
# endif
# define cs_complex_t double _Complex
#endif

#define CS_VER 4 /* CXSparse Version */
Expand All @@ -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 */
/* -------------------------------------------------------------------------- */
Expand Down

0 comments on commit 1796b78

Please sign in to comment.