summaryrefslogtreecommitdiffstatshomepage
path: root/unix/mpconfigport.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-10-15 00:05:55 +0100
committerDamien George <damien.p.george@gmail.com>2015-10-15 00:05:55 +0100
commit4300c7dba2f500cd3b2a664c7491aa3ddb328011 (patch)
treef51c1a0aa2a7e9e56e8276a49fb7ff096a74e0ba /unix/mpconfigport.h
parent74d0df7324f23cfbbc2ae5b0cd0bf7f214fd05e5 (diff)
downloadmicropython-4300c7dba2f500cd3b2a664c7491aa3ddb328011.tar.gz
micropython-4300c7dba2f500cd3b2a664c7491aa3ddb328011.zip
py: Remove dependency on printf/fwrite in mp_plat_print.
See issue #1500.
Diffstat (limited to 'unix/mpconfigport.h')
-rw-r--r--unix/mpconfigport.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 993baca62a..df7fa804e3 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -191,7 +191,8 @@ void mp_unix_mark_exec(void);
#define MP_PLAT_ALLOC_EXEC(min_size, ptr, size) mp_unix_alloc_exec(min_size, ptr, size)
#define MP_PLAT_FREE_EXEC(ptr, size) mp_unix_free_exec(ptr, size)
-#define MP_PLAT_PRINT_STRN(str, len) fwrite(str, 1, len, stdout)
+#include <unistd.h>
+#define MP_PLAT_PRINT_STRN(str, len) write(1, str, len)
#ifdef __linux__
// Can access physical memory using /dev/mem