Skip to content

Commit bd9f850

Browse files
stinospfalcon
authored andcommitted
windows: Use write() instead of fwrite() to avoid out-of-order output.
This fixes the basics/exception_chain.py test, also see adafruit#1500 for more info and [4300c7d] where the same change was done for the other ports.
1 parent d6201fc commit bd9f850

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

windows/mpconfigport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ typedef long mp_off_t;
134134
typedef void *machine_ptr_t; // must be of pointer size
135135
typedef const void *machine_const_ptr_t; // must be of pointer size
136136

137-
#define MP_PLAT_PRINT_STRN(str, len) fwrite(str, 1, len, stdout)
137+
#include <unistd.h>
138+
#define MP_PLAT_PRINT_STRN(str, len) do { int ret = write(1, str, len); (void)ret; } while (0)
138139

139140
extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj;
140141
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;

0 commit comments

Comments
 (0)