[llvm] r250923 - Include llvm/Config/config.h in FileSystem.h as it depends upon HAVE_SYS_STAT_H which is defined (or not) in config.h.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 14:38:52 PDT 2015


On Wed, Oct 21, 2015 at 11:44 AM, Yaron Keren <yaron.keren at gmail.com> wrote:

> Reverted in r250924, thanks!
>
> Since llvm-config.h does not provide the HAVE_* defines, does it makes
> sense for FileSystem.h to include the code
>
> #ifdef HAVE_SYS_STAT_H
> #include <sys/stat.h>
> #endif
>
> shouldn't this code go elsewhere? possibly in the code that needs it?
>

Ideally, yes, it shouldn't be here, but we need it because we use dev_t,
ino_t, and other types from stat.h in file_status.

Personally I think we should just make this #ifdef LLVM_ON_UNIX, because
that matches the uses down below. If we find a system without sys/stat.h,
we can deal with it then.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151021/a46109df/attachment.html>


More information about the llvm-commits mailing list