summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-10-29 07:49:35 +0000
committerJim Meyering <jim@meyering.net>2000-10-29 07:49:35 +0000
commit013d63bb6708b14cca11fe80696cc992edd10d9f (patch)
treeae074bb61332c4f50503b7e022d2a7b1c8267580 /src/ls.c
parentf604c52243eee5eae146b7f743dc3531975a3d82 (diff)
downloadcoreutils-013d63bb6708b14cca11fe80696cc992edd10d9f.tar.xz
(DT_INIT): Define.
[enum filetype]: Remove the #ifdef, and use DT_INIT on the initializers instead.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/ls.c b/src/ls.c
index 9a509417c..65fe79206 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -199,29 +199,24 @@ int rpl_lstat PARAMS((const char *, struct stat *));
#if defined _DIRENT_HAVE_D_TYPE || defined DTTOIF
# define HAVE_STRUCT_DIRENT_D_TYPE 1
+# define DT_INIT(Val) = Val
#else
# define HAVE_STRUCT_DIRENT_D_TYPE 0
+# define DT_INIT(Val) /* empty */
#endif
enum filetype
{
-#if HAVE_STRUCT_DIRENT_D_TYPE
- unknown = DT_UNKNOWN,
- fifo = DT_FIFO,
- chardev = DT_CHR,
- directory = DT_DIR,
- blockdev = DT_BLK,
- normal = DT_REG,
- symbolic_link = DT_LNK,
- sock = DT_SOCK,
- arg_directory = 2 * (DT_UNKNOWN | DT_FIFO | DT_CHR | DT_DIR | DT_BLK
- | DT_REG | DT_LNK | DT_SOCK)
-#else
- symbolic_link,
- directory,
- arg_directory, /* Directory given as command line arg. */
- normal /* All others. */
-#endif
+ unknown DT_INIT (DT_UNKNOWN),
+ fifo DT_INIT (DT_FIFO),
+ chardev DT_INIT (DT_CHR),
+ directory DT_INIT (DT_DIR),
+ blockdev DT_INIT (DT_BLK),
+ normal DT_INIT (DT_REG),
+ symbolic_link DT_INIT (DT_LNK),
+ sock DT_INIT (DT_SOCK),
+ arg_directory DT_INIT (2 * (DT_UNKNOWN | DT_FIFO | DT_CHR | DT_DIR | DT_BLK
+ | DT_REG | DT_LNK | DT_SOCK))
};
struct fileinfo