Skip to content

Commit ec6fa87

Browse files
committed
windows: Sync mpconfigport.h with the unix' version
- rearrange/add definitions that were not there so it's easier to compare both - use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway - define EWOULDBLOCK, it is missing from ingw32
1 parent 8139494 commit ec6fa87

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

py/stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include "stream.h"
3838
#if MICROPY_STREAMS_NON_BLOCK
3939
#include <errno.h>
40+
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
41+
#define EWOULDBLOCK 140
42+
#endif
4043
#endif
4144

4245
// This file defines generic Python stream read/write methods which

unix/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ STATIC char *strjoin(const char *s1, int sep_char, const char *s2) {
147147
}
148148

149149
STATIC void do_repl(void) {
150-
printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; UNIX version\n");
150+
printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_PY_SYS_PLATFORM " version\n");
151151

152152
for (;;) {
153153
char *line = prompt(">>> ");

windows/mpconfigport.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,30 @@
3535
#define MICROPY_EMIT_X64 (0)
3636
#define MICROPY_EMIT_THUMB (0)
3737
#define MICROPY_EMIT_INLINE_THUMB (0)
38+
#define MICROPY_ENABLE_GC (1)
39+
#define MICROPY_ENABLE_FINALISER (1)
3840
#define MICROPY_MEM_STATS (1)
3941
#define MICROPY_DEBUG_PRINTERS (1)
4042
#define MICROPY_HELPER_REPL (1)
4143
#define MICROPY_HELPER_LEXER_UNIX (1)
44+
#define MICROPY_ENABLE_SOURCE_LINE (1)
45+
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
46+
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
47+
#define MICROPY_STREAMS_NON_BLOCK (1)
48+
#define MICROPY_OPT_COMPUTED_GOTO (0)
49+
#define MICROPY_PY_BUILTINS_STR_UNICODE (0)
4250
#define MICROPY_PY_BUILTINS_FROZENSET (1)
43-
#define MICROPY_PY_CMATH (1)
44-
#define MICROPY_PY_SYS_STDFILES (1)
4551
#define MICROPY_PY_SYS_EXIT (1)
46-
#define MICROPY_ENABLE_GC (1)
47-
#define MICROPY_ENABLE_FINALISER (1)
52+
#define MICROPY_PY_SYS_PLATFORM "win32"
53+
#define MICROPY_PY_SYS_STDFILES (1)
54+
#define MICROPY_PY_CMATH (1)
55+
#define MICROPY_PY_IO_FILEIO (1)
4856
#define MICROPY_PY_GC_COLLECT_RETVAL (1)
57+
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
4958
#ifdef _MSC_VER
5059
#define MICROPY_GCREGS_SETJMP (1)
5160
#endif
52-
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
53-
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
61+
5462
#define MICROPY_PORT_INIT_FUNC init()
5563
#define MICROPY_PORT_DEINIT_FUNC deinit()
5664

0 commit comments

Comments
 (0)