From cc0187c5fd4ee5513702d4aa5b3b16d39fcc3188 Mon Sep 17 00:00:00 2001
From: Sergey Fionov <fionov@gmail.com>
Date: Mon, 26 Oct 2009 21:56:13 +0300
Subject: [PATCH 7/7] Ticket #1642
Replace if macros by ifdef
---
src/filegui.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/filegui.c b/src/filegui.c
index 50275c4..9e83ba1 100644
a
|
b
|
|
55 | 55 | #include <sys/types.h> |
56 | 56 | #include <sys/stat.h> |
57 | 57 | |
58 | | #if (STAT_STATVFS \ |
59 | | && (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME)) |
60 | | # define USE_STATVFS 1 |
| 58 | #if defined(STAT_STATVFS) \ |
| 59 | && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) \ |
| 60 | || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)) |
61 | 61 | # include <sys/statvfs.h> |
62 | 62 | # define STRUCT_STATFS struct statvfs |
63 | 63 | # define STATFS statvfs |
64 | | #elif HAVE_STATFS && !STAT_STATFS4 |
65 | | # define USE_STATFS 1 |
66 | | # if HAVE_SYS_VFS_H |
| 64 | #elif defined(HAVE_STATFS) && !defined(STAT_STATFS4) |
| 65 | # ifdef HAVE_SYS_VFS_H |
67 | 66 | # include <sys/vfs.h> |
68 | | # elif HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H |
| 67 | # elif defined(HAVE_SYS_MOUNT_H) && defined(HAVE_SYS_PARAM_H) |
69 | 68 | # include <sys/param.h> |
70 | 69 | # include <sys/mount.h> |
71 | | # elif HAVE_SYS_STATFS_H |
| 70 | # elif defined(HAVE_SYS_STATFS_H) |
72 | 71 | # include <sys/statfs.h> |
73 | 72 | # endif |
74 | 73 | # define STRUCT_STATFS struct statfs |
… |
… |
enum { |
169 | 168 | static int |
170 | 169 | filegui__check_attrs_on_fs(const char *fs_path) |
171 | 170 | { |
172 | | #if USE_STATFS || USE_STATVFS |
| 171 | #ifdef STATFS |
173 | 172 | STRUCT_STATFS stfs; |
174 | 173 | |
175 | 174 | if (STATFS(fs_path, &stfs)!=0) |
… |
… |
filegui__check_attrs_on_fs(const char *fs_path) |
188 | 187 | return 0; |
189 | 188 | break; |
190 | 189 | } |
191 | | # elif HAVE_STRUCT_STATFS_F_FSTYPENAME || HAVE_STRUCT_STATVFS_F_FSTYPENAME |
| 190 | # elif defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) \ |
| 191 | || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME) |
192 | 192 | if (!strcmp(stfs.f_fstypename, "msdos") |
193 | 193 | || !strcmp(stfs.f_fstypename, "msdosfs") |
194 | 194 | || !strcmp(stfs.f_fstypename, "ntfs") |
… |
… |
filegui__check_attrs_on_fs(const char *fs_path) |
196 | 196 | || !strcmp(stfs.f_fstypename, "smbfs") |
197 | 197 | || strstr(stfs.f_fstypename, "fusefs")) |
198 | 198 | return 0; |
199 | | # elif HAVE_STRUCT_STATVFS_F_BASETYPE |
| 199 | # elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE) |
200 | 200 | if (!strcmp(stfs.f_basetype, "pcfs") |
201 | 201 | || !strcmp(stfs.f_basetype, "ntfs") |
202 | 202 | || !strcmp(stfs.f_basetype, "proc") |
… |
… |
filegui__check_attrs_on_fs(const char *fs_path) |
204 | 204 | || !strcmp(stfs.f_basetype, "fuse")) |
205 | 205 | return 0; |
206 | 206 | # endif |
207 | | #endif /* USE_STATFS || USE_STATVFS */ |
| 207 | #endif /* STATFS */ |
208 | 208 | |
209 | 209 | return 1; |
210 | 210 | } |