aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorPaul Eggert2012-11-22 23:48:43 -0800
committerPaul Eggert2012-11-22 23:48:43 -0800
commit95ef7787fb0a5786a2e4f150649aadfa687a15f2 (patch)
treec109235849121c6909c8dd5075ddf63ed847ee82 /src/w32.c
parent6f6b82d66f73e65545865b72f109dbf695934aea (diff)
downloademacs-95ef7787fb0a5786a2e4f150649aadfa687a15f2.tar.gz
emacs-95ef7787fb0a5786a2e4f150649aadfa687a15f2.zip
Assume POSIX 1003.1-1988 or later for dirent.h.
* admin/CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove. * admin/notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming. * configure.ac: Do not check for dirent.h or closdir. * nt/inc/dirent.h: Rename from ../src/ndir.h, with these changes: (struct dirent): Rename from struct direct. All uses changed. * nt/inc/sys/dir.h: Remove. * src/dired.c: Assume HAVE_DIRENT_H. (NAMLEN): Remove, replacing with ... (dirent_namelen): New function. All uses changed. Use the GNU macro _D_EXACT_NAMELEN if available, as it's faster than strlen. (DIRENTRY): Remove, replacing all uses with 'struct dirent'. (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero. * src/makefile.w32-in (DIR_H): Remove. All uses replaced with $(NT_INC)/dirent.h. ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h. * src/ndir.h: Rename to ../nt/inc/dirent.h. * src/sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove. Do not include <dirent.h>; no longer needed. * src/w32.c: Include <dirent.h> rather than "ndir.h". Fixes: debbugs:12958
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/w32.c b/src/w32.c
index 038a442f529..c8e16dfaa94 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -179,7 +179,7 @@ typedef struct _REPARSE_DATA_BUFFER {
179#undef sendto 179#undef sendto
180 180
181#include "w32.h" 181#include "w32.h"
182#include "ndir.h" 182#include <dirent.h>
183#include "w32common.h" 183#include "w32common.h"
184#include "w32heap.h" 184#include "w32heap.h"
185#include "w32select.h" 185#include "w32select.h"
@@ -2448,7 +2448,7 @@ is_exec (const char * name)
2448 and readdir. We can't use the procedures supplied in sysdep.c, 2448 and readdir. We can't use the procedures supplied in sysdep.c,
2449 so we provide them here. */ 2449 so we provide them here. */
2450 2450
2451struct direct dir_static; /* simulated directory contents */ 2451struct dirent dir_static; /* simulated directory contents */
2452static HANDLE dir_find_handle = INVALID_HANDLE_VALUE; 2452static HANDLE dir_find_handle = INVALID_HANDLE_VALUE;
2453static int dir_is_fat; 2453static int dir_is_fat;
2454static char dir_pathname[MAXPATHLEN+1]; 2454static char dir_pathname[MAXPATHLEN+1];
@@ -2518,7 +2518,7 @@ closedir (DIR *dirp)
2518 xfree ((char *) dirp); 2518 xfree ((char *) dirp);
2519} 2519}
2520 2520
2521struct direct * 2521struct dirent *
2522readdir (DIR *dirp) 2522readdir (DIR *dirp)
2523{ 2523{
2524 int downcase = !NILP (Vw32_downcase_file_names); 2524 int downcase = !NILP (Vw32_downcase_file_names);
@@ -2572,7 +2572,7 @@ readdir (DIR *dirp)
2572 downcase = 1; /* 8+3 aliases are returned in all caps */ 2572 downcase = 1; /* 8+3 aliases are returned in all caps */
2573 } 2573 }
2574 dir_static.d_namlen = strlen (dir_static.d_name); 2574 dir_static.d_namlen = strlen (dir_static.d_name);
2575 dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 + 2575 dir_static.d_reclen = sizeof (struct dirent) - MAXNAMLEN + 3 +
2576 dir_static.d_namlen - dir_static.d_namlen % 4; 2576 dir_static.d_namlen - dir_static.d_namlen % 4;
2577 2577
2578 /* If the file name in cFileName[] includes `?' characters, it means 2578 /* If the file name in cFileName[] includes `?' characters, it means