diff options
| author | blmorris <bryan.morrissey@gmail.com> | 2014-07-21 12:47:57 -0400 |
|---|---|---|
| committer | blmorris <bryan.morrissey@gmail.com> | 2014-07-21 12:47:57 -0400 |
| commit | 4038f513ea0a6be75ecbc4d8ab2bbe2349524bca (patch) | |
| tree | 2aace8a3551d5c397ec539865bbb2f6cdbc8d900 /unix | |
| parent | 0f4ee2e44a1e47258a8b07fb25e28286d131390c (diff) | |
| parent | 951ed9d02ffc826c68ee3af26c3530477e7e6156 (diff) | |
Merge https://github.com/micropython/micropython
Diffstat (limited to 'unix')
| -rw-r--r-- | unix/file.c | 9 | ||||
| -rw-r--r-- | unix/mpconfigport.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/unix/file.c b/unix/file.c index 056a7b6e8..7cf0a5193 100644 --- a/unix/file.c +++ b/unix/file.c @@ -39,6 +39,10 @@ #include "runtime.h" #include "stream.h" +#ifdef _WIN32 +#define fsync _commit +#endif + typedef struct _mp_obj_fdfile_t { mp_obj_base_t base; int fd; @@ -83,12 +87,9 @@ STATIC mp_int_t fdfile_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int } STATIC mp_obj_t fdfile_flush(mp_obj_t self_in) { -#ifndef _WIN32 mp_obj_fdfile_t *self = self_in; + check_fd_is_open(self); fsync(self->fd); -#else - //TODO -#endif return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_flush_obj, fdfile_flush); diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index 0831e3fd3..ce4365d36 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -43,7 +43,7 @@ #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_OPT_COMPUTED_GOTO (1) -#define MICROPY_PY_BUILTINS_STR_UNICODE (0) +#define MICROPY_PY_BUILTINS_STR_UNICODE (1) #define MICROPY_PY_BUILTINS_FROZENSET (1) #define MICROPY_PY_SYS_EXIT (1) #define MICROPY_PY_SYS_PLATFORM "linux" |
