From 61e77a4e88c4b6971fd997191de01e5ab08e46c5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 30 Jul 2016 20:05:56 +0300 Subject: 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. --- py/stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'py/stream.c') 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 -- cgit v1.2.3