From c1727fec5d312d96d4e903cec57ea37fbd89ad90 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Wed, 15 Sep 2021 11:05:59 +0200 Subject: [PATCH] Implemented C/C++ fix for complex.h --- cbind/base/psb_c_base.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cbind/base/psb_c_base.h b/cbind/base/psb_c_base.h index 0e5a09f9..82c4cda9 100644 --- a/cbind/base/psb_c_base.h +++ b/cbind/base/psb_c_base.h @@ -32,8 +32,15 @@ extern "C" { typedef float psb_s_t; typedef double psb_d_t; - typedef float complex psb_c_t; - typedef double complex psb_z_t; + +#ifdef __cplusplus + using psb_c_t = std::complex; + using psb_z_t = std::complex; +#else + typedef float complex psb_c_t; + typedef float complex psb_z_t; +#endif + #define PSB_ERR_ERROR -1 #define PSB_ERR_SUCCESS 0