From: Reid Spencer Date: Mon, 27 Dec 2004 06:17:15 +0000 (+0000) Subject: For PR351: X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=af2f208e7c727f75ee279d63c6b722da0d75fced;p=oota-llvm.git For PR351: * Ensure #includes are wrapped with appropriate HAVE_ guards * Ensure variations in "dirent" structure are accounted for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19158 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/System/Unix/Path.cpp b/lib/System/Unix/Path.cpp index f1d6938e31f..99923335c5a 100644 --- a/lib/System/Unix/Path.cpp +++ b/lib/System/Unix/Path.cpp @@ -18,11 +18,35 @@ #include "llvm/Config/alloca.h" #include "Unix.h" +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_FCNTL_H #include +#endif +#if HAVE_UTIME_H #include -#include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + namespace llvm { using namespace sys; diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index f1d6938e31f..99923335c5a 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -18,11 +18,35 @@ #include "llvm/Config/alloca.h" #include "Unix.h" +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_FCNTL_H #include +#endif +#if HAVE_UTIME_H #include -#include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + namespace llvm { using namespace sys;