From 13260f95b0d35def50f2f4dc9bfe5b04f670fbdd Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Thu, 2 Apr 2020 15:08:08 -0400 Subject: Properly handle C99 complex types even in C++ mode Use the `_Complex` keyword rather than the `complex` macro. Fixes #1487. --- Lib/python/ccomplex.i | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/python') diff --git a/Lib/python/ccomplex.i b/Lib/python/ccomplex.i index 28872b985..17163506b 100644 --- a/Lib/python/ccomplex.i +++ b/Lib/python/ccomplex.i @@ -16,11 +16,11 @@ /* C complex constructor */ #define CCplxConst(r, i) ((r) + I*(i)) -%swig_cplxflt_convn(float complex, CCplxConst, creal, cimag); -%swig_cplxdbl_convn(double complex, CCplxConst, creal, cimag); +%swig_cplxflt_convn(float _Complex, CCplxConst, creal, cimag); +%swig_cplxdbl_convn(double _Complex, CCplxConst, creal, cimag); %swig_cplxdbl_convn(complex, CCplxConst, creal, cimag); /* declaring the typemaps */ -%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float complex); -%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double complex); +%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float _Complex); +%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double _Complex); %typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, complex); -- cgit v1.2.1