diff options
| author | Dan Halbert <halbert@adafruit.com> | 2020-10-14 22:39:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-14 22:39:04 -0400 |
| commit | f1e8f2b404ef45edf08b019c1e68d595aa69b357 (patch) | |
| tree | 0a8292c9d01bb06fa2dcc12d9d0ba364774713e9 | |
| parent | b84f22aa0c404cfd83eab5f15f1415b27f508ae8 (diff) | |
| parent | f6f89565d83c0ac942496f29394ff59976aaa5b9 (diff) | |
Merge pull request #3554 from gamblor21/move_ordereddict
Moved ORDEREDDICT define to central location
| -rw-r--r-- | ports/atmel-samd/mpconfigport.h | 3 | ||||
| -rw-r--r-- | ports/litex/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/mimxrt10xx/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/nrf/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/stm/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/unix/mpconfigport.h | 1 | ||||
| -rw-r--r-- | ports/unix/mpconfigport_coverage.h | 1 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.h | 3 | ||||
| -rw-r--r-- | py/objnamedtuple.c | 2 |
9 files changed, 5 insertions, 9 deletions
diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index f185142e4..f7ccff4da 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -43,12 +43,12 @@ #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_FUNCTION_ATTRS (0) // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) #define MICROPY_PY_UJSON (0) +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ X(ENOENT) \ @@ -81,7 +81,6 @@ #endif #define SPI_FLASH_MAX_BAUDRATE 24000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (1) diff --git a/ports/litex/mpconfigport.h b/ports/litex/mpconfigport.h index fcf9d3b73..a7caf8526 100644 --- a/ports/litex/mpconfigport.h +++ b/ports/litex/mpconfigport.h @@ -30,7 +30,6 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #define MICROPY_NLR_THUMB (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) #define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UJSON (1) diff --git a/ports/mimxrt10xx/mpconfigport.h b/ports/mimxrt10xx/mpconfigport.h index 7e7df0123..7496256d0 100644 --- a/ports/mimxrt10xx/mpconfigport.h +++ b/ports/mimxrt10xx/mpconfigport.h @@ -40,7 +40,6 @@ extern uint8_t _ld_default_stack_size; // 20kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t) &_ld_default_stack_size) #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_FUNCTION_ATTRS (0) #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 36a9819dc..4ed42cd82 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -34,7 +34,6 @@ #include "nrf_sdm.h" // for SD_FLASH_SIZE #include "peripherals/nrf/nvm.h" // for FLASH_PAGE_SIZE -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index e054ffbb5..9489b4765 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -30,7 +30,6 @@ #include <stdint.h> -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 3ae4ff786..d6bbad9ce 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -99,7 +99,6 @@ #define MICROPY_PY_SYS_STDFILES (1) #define MICROPY_PY_SYS_EXC_INFO (1) #define MICROPY_PY_COLLECTIONS_DEQUE (1) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #ifndef MICROPY_PY_MATH_SPECIAL_FUNCTIONS #define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1) #endif diff --git a/ports/unix/mpconfigport_coverage.h b/ports/unix/mpconfigport_coverage.h index 51015a587..468d69a73 100644 --- a/ports/unix/mpconfigport_coverage.h +++ b/ports/unix/mpconfigport_coverage.h @@ -49,7 +49,6 @@ #define MICROPY_VFS_FAT (1) #define MICROPY_FATFS_USE_LABEL (1) #define MICROPY_PY_FRAMEBUF (1) -#define MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT (1) // TODO these should be generic, not bound to fatfs #define mp_type_fileio mp_type_vfs_posix_fileio diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 5ffdd4c8f..1e01bd9c5 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -194,6 +194,9 @@ typedef long mp_off_t; #define MICROPY_PY_BUILTINS_STR_PARTITION (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_STR_SPLITLINES (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_UERRNO (CIRCUITPY_FULL_BUILD) +#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) +#endif // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_URE diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index 6c36909e7..ab2f2f3c0 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -46,7 +46,7 @@ size_t mp_obj_namedtuple_find_field(const mp_obj_namedtuple_type_t *type, qstr n return (size_t)-1; } -#if MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT +#if MICROPY_PY_COLLECTIONS_ORDEREDDICT STATIC mp_obj_t namedtuple_asdict(mp_obj_t self_in) { mp_obj_namedtuple_t *self = MP_OBJ_TO_PTR(self_in); const qstr *fields = ((mp_obj_namedtuple_type_t*)self->tuple.base.type)->fields; |
