Adhemerval Zanella wrote: > +/* Any distinct values will do here. > + Undef any existing macros out of the way. */ > +#ifndef DT_UNKNOWN > +# define DT_UNKNOWN 0 > +#endif > +#ifndef DT_DIR > +# define DT_DIR 1 > +#endif > +#ifndef DT_LNK > +# define DT_LNK 2 > +#endif The comment here does not match the code, as nothing is being undeffed. Instead of this change, how about the following? #if !defined _LIBC && !defined HAVE_STRUCT_DIRENT_D_TYPE /* Any distinct values will do here. Undef any existing macros out of the way. */ # undef DT_UNKNOWN # undef DT_DIR # undef DT_LNK # define DT_UNKNOWN 0 # define DT_DIR 1 # define DT_LNK 2 #endif This makes it more clear to the casual reader that this code is for use only outside glibc. Also, it's more robust for hopefully only-hypothetical non-glibc platforms that define some DT_ symbols but not others, because it guarantees their uniqueness in that case. I installed the attached patch into Gnulib, along these lines.