@@ -854,6 +854,24 @@ np_double_complex(_structmodulestate *state, char *p, PyObject *v,
854854 memcpy (p , (char * )& x , sizeof (x ));
855855 return 0 ;
856856}
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+ }
857875#endif
858876
859877static int
@@ -897,6 +915,9 @@ static const formatdef native_table[] = {
897915#ifdef Py_HAVE_C_COMPLEX
898916 {'E' , sizeof (float complex ), FLOAT_COMPLEX_ALIGN , nu_float_complex , np_float_complex },
899917 {'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 },
900921#endif
901922 {'P' , sizeof (void * ), VOID_P_ALIGN , nu_void_p , np_void_p },
902923 {0 }
@@ -1236,6 +1257,9 @@ static formatdef bigendian_table[] = {
12361257#ifdef Py_HAVE_C_COMPLEX
12371258 {'E' , 8 , 0 , bu_float_complex , bp_float_complex },
12381259 {'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 },
12391263#endif
12401264 {0 }
12411265};
@@ -1559,6 +1583,9 @@ static formatdef lilendian_table[] = {
15591583#ifdef Py_HAVE_C_COMPLEX
15601584 {'E' , 8 , 0 , lu_float_complex , lp_float_complex },
15611585 {'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 },
15621589#endif
15631590 {0 }
15641591};
0 commit comments