@@ -854,6 +854,24 @@ 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
+ np_complex_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
+ }
867
+ static PyObject *
868
+ nu_complex_stub (_structmodulestate * state , const char * p , const formatdef * f )
869
+ {
870
+ PyErr_Format (state -> StructError ,
871
+ "'%c' format not supported on this system" ,
872
+ f -> format );
873
+ return NULL ;
874
+ }
857
875
#endif
858
876
859
877
static int
@@ -897,6 +915,9 @@ static const formatdef native_table[] = {
897
915
#ifdef Py_HAVE_C_COMPLEX
898
916
{'E' , sizeof (float complex ), FLOAT_COMPLEX_ALIGN , nu_float_complex , np_float_complex },
899
917
{'C' , sizeof (double complex ), DOUBLE_COMPLEX_ALIGN , nu_double_complex , np_double_complex },
918
+ #else
919
+ {'E' , 1 , 0 , nu_complex_stub , np_complex_stub },
920
+ {'C' , 1 , 0 , nu_complex_stub , np_complex_stub },
900
921
#endif
901
922
{'P' , sizeof (void * ), VOID_P_ALIGN , nu_void_p , np_void_p },
902
923
{0 }
@@ -1236,6 +1257,9 @@ static formatdef bigendian_table[] = {
1236
1257
#ifdef Py_HAVE_C_COMPLEX
1237
1258
{'E' , 8 , 0 , bu_float_complex , bp_float_complex },
1238
1259
{'C' , 16 , 0 , bu_double_complex , bp_double_complex },
1260
+ #else
1261
+ {'E' , 1 , 0 , nu_complex_stub , np_complex_stub },
1262
+ {'C' , 1 , 0 , nu_complex_stub , np_complex_stub },
1239
1263
#endif
1240
1264
{0 }
1241
1265
};
@@ -1559,6 +1583,9 @@ static formatdef lilendian_table[] = {
1559
1583
#ifdef Py_HAVE_C_COMPLEX
1560
1584
{'E' , 8 , 0 , lu_float_complex , lp_float_complex },
1561
1585
{'C' , 16 , 0 , lu_double_complex , lp_double_complex },
1586
+ #else
1587
+ {'E' , 1 , 0 , nu_complex_stub , np_complex_stub },
1588
+ {'C' , 1 , 0 , nu_complex_stub , np_complex_stub },
1562
1589
#endif
1563
1590
{0 }
1564
1591
};
0 commit comments