@@ -854,6 +854,16 @@ np_double_complex(_structmodulestate *state, char *p, PyObject *v,
854
854
memcpy (p , (char * )& x , sizeof (x ));
855
855
return 0 ;
856
856
}
857
+ #else
858
+ static int
859
+ complex_format_stub (_structmodulestate * state , char * p , PyObject * v ,
860
+ const formatdef * f )
861
+ {
862
+ PyErr_Format (state -> StructError ,
863
+ "'%c' format not supported on this system" ,
864
+ f -> format );
865
+ return -1 ;
866
+ }
857
867
#endif
858
868
859
869
static int
@@ -897,6 +907,9 @@ static const formatdef native_table[] = {
897
907
#ifdef Py_HAVE_C_COMPLEX
898
908
{'E' , sizeof (float complex ), FLOAT_COMPLEX_ALIGN , nu_float_complex , np_float_complex },
899
909
{'C' , sizeof (double complex ), DOUBLE_COMPLEX_ALIGN , nu_double_complex , np_double_complex },
910
+ #else
911
+ {'E' , 1 , 0 , complex_format_stub , complex_format_stub },
912
+ {'C' , 1 , 0 , complex_format_stub , complex_format_stub },
900
913
#endif
901
914
{'P' , sizeof (void * ), VOID_P_ALIGN , nu_void_p , np_void_p },
902
915
{0 }
@@ -1236,6 +1249,9 @@ static formatdef bigendian_table[] = {
1236
1249
#ifdef Py_HAVE_C_COMPLEX
1237
1250
{'E' , 8 , 0 , bu_float_complex , bp_float_complex },
1238
1251
{'C' , 16 , 0 , bu_double_complex , bp_double_complex },
1252
+ #else
1253
+ {'E' , 1 , 0 , complex_format_stub , complex_format_stub },
1254
+ {'C' , 1 , 0 , complex_format_stub , complex_format_stub },
1239
1255
#endif
1240
1256
{0 }
1241
1257
};
@@ -1559,6 +1575,9 @@ static formatdef lilendian_table[] = {
1559
1575
#ifdef Py_HAVE_C_COMPLEX
1560
1576
{'E' , 8 , 0 , lu_float_complex , lp_float_complex },
1561
1577
{'C' , 16 , 0 , lu_double_complex , lp_double_complex },
1578
+ #else
1579
+ {'E' , 1 , 0 , complex_format_stub , complex_format_stub },
1580
+ {'C' , 1 , 0 , complex_format_stub , complex_format_stub },
1562
1581
#endif
1563
1582
{0 }
1564
1583
};
0 commit comments