diff options
Diffstat (limited to 'windows/mpconfigport.h')
-rw-r--r-- | windows/mpconfigport.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index b9a50b0841..c930fe95e8 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -43,6 +43,12 @@ #define MICROPY_PY_CMATH (1) #define MICROPY_PY_SYS_STDFILES (1) #define MICROPY_PY_SYS_EXIT (1) +#define MICROPY_ENABLE_GC (1) +#define MICROPY_ENABLE_FINALISER (1) +#define MICROPY_PY_GC_COLLECT_RETVAL (1) +#ifdef _MSC_VER +#define MICROPY_GCREGS_SETJMP (1) +#endif #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_PORT_INIT_FUNC init() @@ -113,6 +119,14 @@ void msec_sleep(double msec); #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +// Put static/global variables in sections with a known name we can lookup for the GC +// For this to work this header must be included by all sources, which is the case normally +#define MICROPY_PORT_DATASECTION "upydata" +#define MICROPY_PORT_BSSSECTION "upybss" +#pragma data_seg(MICROPY_PORT_DATASECTION) +#pragma bss_seg(MICROPY_PORT_BSSSECTION) + + // System headers (needed e.g. for nlr.h) #include <stddef.h> //for NULL @@ -122,3 +136,8 @@ void msec_sleep(double msec); int snprintf(char *dest, size_t count, const char *format, ...); #endif + +// MingW specifics +#ifdef __MINGW32__ +#define MICROPY_PORT_BSSSECTION ".bss" +#endif |