aboutsummaryrefslogtreecommitdiff
path: root/py/stream.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-30 20:05:56 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-30 20:05:56 +0300
commit61e77a4e88c4b6971fd997191de01e5ab08e46c5 (patch)
treefff2891aa94810f76849050fe02504c8599a0ab4 /py/stream.c
parent58d9d85a564bbae5fa7eaa1f0baa62be56024366 (diff)
py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.
To filter out even prototypes of mp_stream_posix_*() functions, which require POSIX types like ssize_t & off_t, which may be not available in some ports.
Diffstat (limited to 'py/stream.c')
-rw-r--r--py/stream.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/stream.c b/py/stream.c
index d426973e8..473eb9690 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -511,6 +511,7 @@ STATIC mp_obj_t stream_ioctl(size_t n_args, const mp_obj_t *args) {
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj, 2, 3, stream_ioctl);
+#if MICROPY_STREAMS_POSIX_API
/*
* POSIX-like functions
*
@@ -519,7 +520,6 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj, 2, 3, stream_ioctl);
* POSIX-compatible software to work with MicroPython streams.
*/
-
// errno-like variable. If any of the functions below returned with error
// status, this variable will contain error no.
int mp_stream_errno;
@@ -568,3 +568,5 @@ int mp_stream_posix_fsync(mp_obj_t stream) {
}
return res;
}
+
+#endif