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.
This commit is contained in:
Paul Sokolovsky
2016-07-30 20:05:56 +03:00
parent 58d9d85a56
commit 61e77a4e88
5 changed files with 13 additions and 1 deletions

View File

@@ -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