aboutsummaryrefslogtreecommitdiff
path: root/mpy-cross
diff options
context:
space:
mode:
Diffstat (limited to 'mpy-cross')
-rw-r--r--mpy-cross/Makefile4
-rw-r--r--mpy-cross/main.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile
index 71b78c27c..ecf26ee31 100644
--- a/mpy-cross/Makefile
+++ b/mpy-cross/Makefile
@@ -49,6 +49,10 @@ SRC_C = \
main.c \
gccollect.c \
+ifeq ($(OS),Windows_NT)
+SRC_C += windows/fmode.c
+endif
+
OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
diff --git a/mpy-cross/main.c b/mpy-cross/main.c
index 4393d00ff..5e5bc7330 100644
--- a/mpy-cross/main.c
+++ b/mpy-cross/main.c
@@ -35,6 +35,9 @@
#include "py/runtime.h"
#include "py/gc.h"
#include "py/stackctrl.h"
+#ifdef _WIN32
+#include "windows/fmode.h"
+#endif
// Command line options, with their defaults
STATIC uint emit_opt = MP_EMIT_OPT_NONE;
@@ -185,6 +188,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
gc_init(heap, heap + heap_size);
mp_init();
+#ifdef _WIN32
+ set_fmode_binary();
+#endif
mp_obj_list_init(mp_sys_path, 0);
mp_obj_list_init(mp_sys_argv, 0);