Handle T_FLTCPLX in NewSwigType()

This fixes an assertion failure and segfault trying to use %constant
to deduce the type of a "float _Complex" constant.
This commit is contained in:
Olly Betts 2024-01-31 14:23:11 +13:00
parent 3de7c6723e
commit e5af5dcadb
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,11 @@
#endif
%}
%inline %{
static float _Complex CPLX_CONSTANT_ = 0;
%}
%constant CPLX_CONSTANT = CPLX_CONSTANT_;
%inline
{
int has_c99_complex(void) {

View File

@ -131,6 +131,8 @@ SwigType *NewSwigType(int t) {
return NewString("double");
case T_LONGDOUBLE:
return NewString("long double");
case T_FLTCPLX:
return NewString("float _Complex");
case T_COMPLEX:
return NewString("_Complex");
case T_CHAR: