llvm.org GIT mirror llvm / b96411e
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." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328989 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 2 years ago
3 changed file(s) with 3 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
2525 endif()
2626
2727 # include checks
28 check_include_file(dirent.h HAVE_DIRENT_H)
2928 check_include_file(dlfcn.h HAVE_DLFCN_H)
3029 check_include_file(errno.h HAVE_ERRNO_H)
3130 check_include_file(fcntl.h HAVE_FCNTL_H)
4242 /* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
4343 #cmakedefine01 LLVM_ENABLE_DIA_SDK
4444
45 /* Define to 1 if you have the header file, and it defines `DIR'.
46 */
47 #cmakedefine HAVE_DIRENT_H ${HAVE_DIRENT_H}
48
4945 /* Define to 1 if you have the header file. */
5046 #cmakedefine HAVE_DLFCN_H ${HAVE_DLFCN_H}
5147
3030 #ifdef HAVE_SYS_MMAN_H
3131 #include
3232 #endif
33 #if HAVE_DIRENT_H
34 # include
35 # define NAMLEN(dirent) strlen((dirent)->d_name)
36 #else
37 # define dirent direct
38 # define NAMLEN(dirent) (dirent)->d_namlen
39 # if HAVE_SYS_NDIR_H
40 # include
41 # endif
42 # if HAVE_SYS_DIR_H
43 # include
44 # endif
45 # if HAVE_NDIR_H
46 # include
47 # endif
48 #endif
49
33
34 #include
5035 #include
5136
5237 #ifdef __APPLE__
703688 if (cur_dir == nullptr && errno != 0) {
704689 return std::error_code(errno, std::generic_category());
705690 } else if (cur_dir != nullptr) {
706 StringRef name(cur_dir->d_name, NAMLEN(cur_dir));
691 StringRef name(cur_dir->d_name);
707692 if ((name.size() == 1 && name[0] == '.') ||
708693 (name.size() == 2 && name[0] == '.' && name[1] == '.'))
709694 return directory_iterator_increment(it);