unix/modos: Allow to configure use of d_ino using _DIRENT_HAVE_D_INO.

Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use.
This commit is contained in:
Damien George 2015-12-16 13:21:09 +00:00
parent be3ae9d13c
commit 3386477b29
1 changed files with 4 additions and 0 deletions

View File

@ -184,7 +184,11 @@ STATIC mp_obj_t listdir_next(mp_obj_t self_in) {
// DT_UNKNOWN should have 0 value on any reasonable system
t->items[1] = 0;
#endif
#if !defined(_DIRENT_HAVE_D_INO) || _DIRENT_HAVE_D_INO
t->items[2] = MP_OBJ_NEW_SMALL_INT(dirent->d_ino);
#else
t->items[1] = MP_OBJ_NEW_SMALL_INT(0);
#endif
return MP_OBJ_FROM_PTR(t);
}