[lldb-dev] [PATCH] r124716 - make dirent usage more portable

Jai Menon jmenon86 at gmail.com
Fri Feb 4 21:02:54 PST 2011


Hello Kirk,

On Fri, Feb 4, 2011 at 10:29 PM,  <kirk.beitz at nokia.com> wrote:
> Jai ++
> I am experiencing another problem in relation to this same code:  the d_type
> is also not mentioned in the URL you site, and the build i am attempting
> under MinGW fails because of this.

Indeed, d_type is a POSIX extension as well but you'll pretty much
find it on all *nix/BSD variants. I guess you're out of luck on
windows because I doubt whether mingw (or even mingw64 and cygwin)
will get proper dirent support anytime soon. I guess applications
either perform a readdir followed by a stat (so that takes care of
DT_DIR and DT_REG) or have full-blown dirent emulation code (example
msysgit) which uses windows API calls. The later approach should be
sufficient for the usage in FileSpec.cpp, even if not all file types
are supported.

> This patch looks like a reasonable start.  I may have to build onto it to
> make it more cross-platform friendly with windows.

I could try a few hacks but I don't have access to a mingw cross
toolchain right now. It might get a bit ugly though.

-- 
Jai Menon




More information about the lldb-dev mailing list