unix: Change define logic of _DIRENT_HAVE_D_INO to match other macros.

This commit is contained in:
Damien George 2015-12-16 14:17:56 +00:00
parent 64a909ef51
commit 0d7de08e06
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -259,3 +259,8 @@ extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#ifndef _DIRENT_HAVE_D_TYPE
#define _DIRENT_HAVE_D_TYPE (1)
#endif
// This macro is not provided by glibc but we need it so ports that don't have
// dirent->d_ino can disable the use of this field.
#ifndef _DIRENT_HAVE_D_INO
#define _DIRENT_HAVE_D_INO (1)
#endif

View File

@ -35,4 +35,4 @@
#define MICROPY_PY_SYS_PLATFORM "freedos"
// djgpp dirent struct does not have d_ino field
#define _DIRENT_HAVE_D_INO (0)
#undef _DIRENT_HAVE_D_INO