diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-04-02 17:17:29 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-04-02 17:17:29 +0000 |
commit | f3db8e3c70491442e2747e2dfa8cc3c07b3b40d1 (patch) | |
tree | a729f219b26785691e40c2a5d9f5c6a79915a410 /llvm/lib/Support/Unix/Path.inc | |
parent | b181c7312e17a31ab91f505c797e7df7f9c112d6 (diff) | |
download | bcm5719-llvm-f3db8e3c70491442e2747e2dfa8cc3c07b3b40d1.tar.gz bcm5719-llvm-f3db8e3c70491442e2747e2dfa8cc3c07b3b40d1.zip |
Remove HAVE_DIRENT_H.
The autoconf manual: "This macro is obsolescent, as all current systems with
directory libraries have <dirent.h>. New programs need not use this macro."
llvm-svn: 328989
Diffstat (limited to 'llvm/lib/Support/Unix/Path.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 1d5e56dc3cf..9bd8cca3738 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -31,23 +31,8 @@ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif -#if HAVE_DIRENT_H -# include <dirent.h> -# define NAMLEN(dirent) strlen((dirent)->d_name) -#else -# define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen -# if HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif -# if HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif -# if HAVE_NDIR_H -# include <ndir.h> -# endif -#endif +#include <dirent.h> #include <pwd.h> #ifdef __APPLE__ @@ -704,7 +689,7 @@ std::error_code detail::directory_iterator_increment(detail::DirIterState &it) { if (cur_dir == nullptr && errno != 0) { return std::error_code(errno, std::generic_category()); } else if (cur_dir != nullptr) { - StringRef name(cur_dir->d_name, NAMLEN(cur_dir)); + StringRef name(cur_dir->d_name); if ((name.size() == 1 && name[0] == '.') || (name.size() == 2 && name[0] == '.' && name[1] == '.')) return directory_iterator_increment(it); |