Skip to content

Commit 081c064

Browse files
Renato Aguiardpgeorge
authored andcommitted
unix: Fix build for when MICROPY_PY_SOCKET=0.
1 parent dd0e6dd commit 081c064

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

unix/moduselect.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
#include "py/mphal.h"
4141
#include "fdfile.h"
4242

43+
#if MICROPY_PY_SOCKET
4344
extern const mp_obj_type_t mp_type_socket;
45+
#endif
4446

4547
// Flags for poll()
4648
#define FLAG_ONESHOT (1)
@@ -57,7 +59,11 @@ typedef struct _mp_obj_poll_t {
5759
STATIC int get_fd(mp_obj_t fdlike) {
5860
int fd;
5961
// Shortcut for fdfile compatible types
60-
if (MP_OBJ_IS_TYPE(fdlike, &mp_type_fileio) || MP_OBJ_IS_TYPE(fdlike, &mp_type_socket)) {
62+
if (MP_OBJ_IS_TYPE(fdlike, &mp_type_fileio)
63+
#if MICROPY_PY_SOCKET
64+
|| MP_OBJ_IS_TYPE(fdlike, &mp_type_socket)
65+
#endif
66+
) {
6167
mp_obj_fdfile_t *fdfile = MP_OBJ_TO_PTR(fdlike);
6268
fd = fdfile->fd;
6369
} else {

0 commit comments

Comments
 (0)