summaryrefslogtreecommitdiffstatshomepage
path: root/windows/mpconfigport.h
diff options
context:
space:
mode:
Diffstat (limited to 'windows/mpconfigport.h')
-rw-r--r--windows/mpconfigport.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
index b9a50b0841..963fcfe768 100644
--- a/windows/mpconfigport.h
+++ b/windows/mpconfigport.h
@@ -35,16 +35,30 @@
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
+#define MICROPY_ENABLE_GC (1)
+#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_MEM_STATS (1)
#define MICROPY_DEBUG_PRINTERS (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_HELPER_LEXER_UNIX (1)
-#define MICROPY_PY_BUILTINS_FROZENSET (1)
-#define MICROPY_PY_CMATH (1)
-#define MICROPY_PY_SYS_STDFILES (1)
-#define MICROPY_PY_SYS_EXIT (1)
+#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
+#define MICROPY_STREAMS_NON_BLOCK (1)
+#define MICROPY_OPT_COMPUTED_GOTO (0)
+#define MICROPY_PY_BUILTINS_STR_UNICODE (0)
+#define MICROPY_PY_BUILTINS_FROZENSET (1)
+#define MICROPY_PY_SYS_EXIT (1)
+#define MICROPY_PY_SYS_PLATFORM "win32"
+#define MICROPY_PY_SYS_STDFILES (1)
+#define MICROPY_PY_CMATH (1)
+#define MICROPY_PY_IO_FILEIO (1)
+#define MICROPY_PY_GC_COLLECT_RETVAL (1)
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
+#ifdef _MSC_VER
+#define MICROPY_GCREGS_SETJMP (1)
+#endif
+
#define MICROPY_PORT_INIT_FUNC init()
#define MICROPY_PORT_DEINIT_FUNC deinit()
@@ -113,6 +127,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 +144,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