@@ -289,8 +289,10 @@ mp_obj_t mp_binary_get_val_array(char typecode, void *p, size_t index) {
289289 #if MICROPY_PY_BUILTINS_FLOAT
290290 case 'f' :
291291 return mp_obj_new_float_from_f (((float * )p )[index ]);
292+ #if MICROPY_PY_DOUBLE_TYPECODE
292293 case 'd' :
293294 return mp_obj_new_float_from_d (((double * )p )[index ]);
295+ #endif
294296 #endif
295297 // CIRCUITPY-CHANGE: non-standard typecodes can be turned off
296298 #if MICROPY_NONSTANDARD_TYPECODES
@@ -367,13 +369,15 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte *p_base, byte *
367369 float f ;
368370 } fpu = {val };
369371 return mp_obj_new_float_from_f (fpu .f );
372+ #if MICROPY_PY_DOUBLE_TYPECODE
370373 } else if (val_type == 'd' ) {
371374 union {
372375 uint64_t i ;
373376 double f ;
374377 } fpu = {val };
375378 return mp_obj_new_float_from_d (fpu .f );
376379 #endif
380+ #endif
377381 } else if (is_signed (val_type )) {
378382 if ((long long )MP_SMALL_INT_MIN <= val && val <= (long long )MP_SMALL_INT_MAX ) {
379383 return mp_obj_new_int ((mp_int_t )val );
@@ -445,6 +449,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte *p
445449 val = fp_sp .i ;
446450 break ;
447451 }
452+ #if MICROPY_PY_DOUBLE_TYPECODE
448453 case 'd' : {
449454 union {
450455 uint64_t i64 ;
@@ -463,6 +468,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte *p
463468 break ;
464469 }
465470 #endif
471+ #endif
466472 default : {
467473 // CIRCUITPY-CHANGE: add overflow checks
468474 bool signed_type = is_signed (val_type );
@@ -501,10 +507,12 @@ void mp_binary_set_val_array(char typecode, void *p, size_t index, mp_obj_t val_
501507 case 'f' :
502508 ((float * )p )[index ] = mp_obj_get_float_to_f (val_in );
503509 break ;
510+ #if MICROPY_PY_DOUBLE_TYPECODE
504511 case 'd' :
505512 ((double * )p )[index ] = mp_obj_get_float_to_d (val_in );
506513 break ;
507514 #endif
515+ #endif
508516 // CIRCUITPY-CHANGE: non-standard typecodes can be turned off
509517 #if MICROPY_NONSTANDARD_TYPECODES
510518 // Extension to CPython: array of objects
@@ -574,9 +582,11 @@ void mp_binary_set_val_array_from_int(char typecode, void *p, size_t index, mp_i
574582 case 'f' :
575583 ((float * )p )[index ] = (float )val ;
576584 break ;
585+ #if MICROPY_PY_DOUBLE_TYPECODE
577586 case 'd' :
578587 ((double * )p )[index ] = (double )val ;
579588 break ;
589+ #endif
580590 #endif
581591 // CIRCUITPY-CHANGE: non-standard typecodes can be turned off
582592 #if MICROPY_NONSTANDARD_TYPECODES
0 commit comments