Browse Source

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

pull/1727/head
Damien George 9 years ago
parent
commit
0d7de08e06
  1. 2
      unix/modos.c
  2. 5
      unix/mpconfigport.h
  3. 2
      unix/mpconfigport_freedos.h

2
unix/modos.c

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

5
unix/mpconfigport.h

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

2
unix/mpconfigport_freedos.h

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

Loading…
Cancel
Save