diff options
| author | ruki <[email protected]> | 2019-07-10 23:08:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-07-10 12:49:58 +0800 |
| commit | e75bf9ac31aa544fd44a3e9da3bdcb4fd3d86004 (patch) | |
| tree | ca3c35bd1ab2e366ae37447f03dc9e9f618b5d25 /core/src | |
| parent | 306462119f4eac0d30befc50fe0aa5a49e7fd400 (diff) | |
fix io.write for unix
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/io/file_write.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/xmake/io/file_write.c b/core/src/xmake/io/file_write.c index 57c2043ea..553b91996 100644 --- a/core/src/xmake/io/file_write.c +++ b/core/src/xmake/io/file_write.c @@ -47,6 +47,8 @@ static tb_void_t xm_io_file_write_file_transcrlf(xm_io_file* file, tb_char_t con // check tb_assert(file && data && xm_io_file_is_file(file) && !xm_io_file_is_closed(file)); +#ifdef TB_CONFIG_OS_WINDOWS + // write cached data first tb_byte_t const* odata = tb_buffer_data(&file->wcache); tb_size_t osize = tb_buffer_size(&file->wcache); @@ -86,6 +88,9 @@ static tb_void_t xm_io_file_write_file_transcrlf(xm_io_file* file, tb_char_t con break; } } +#else + return xm_io_file_write_file_directly(file, data, size); +#endif } static tb_void_t xm_io_file_write_std(xm_io_file* file, tb_char_t const* data, tb_size_t size) { |
