This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 00/18] posix: glob fixes and refactor
On 08/17/2017 10:32 AM, Adhemerval Zanella wrote:
My understanding from Florian comment is the 'decoupled' version would be the
code with both win32/amiga/etc code striped and LIBC defines set to only glibc.
Would it be acceptable for gnulib?
We don't need Amiga code any more. MS-Windows support is still used,
though. However, the current style in glob.c with the forest of ifdefs
is pretty bad, and it'd be good to see it go. Instead, I'd rather have
the Gnulib-specific stuff put into a section that is relatively
independent of the rest of the code. To do that, I suggest that you just
rip out all the MS-Windows code, and I'll do my best to reintroduce it
in a cleaner way.
This would also remove the d_ino/d_type abstraction macros.
We'll still need some form of abstraction. For fts.c Gnulib is using
something like the following, and we could do this sort of thing in
glob.c too. It's not much of a burden to write 'D_INO (dp)' instead of
'dp->d_ino' in the mainline code.
#if defined _LIBC || defined D_INO_IN_DIRENT
# define D_INO(dp) (dp)->d_ino
#else
# define D_INO(dp) 0
#endif
By the way, I've lost track: have you looked at the Gnulib fixes for
glob.c, and merged them into your glibc patch?