Ticket #3430: mc-indroduct-wundef-check-02_v2.patch
File mc-indroduct-wundef-check-02_v2.patch, 3.1 KB (added by and, 10 years ago) |
---|
-
lib/fs.h
introduce -Wundef check to catch macro typos more infos about motivation at https://sourceware.org/glibc/wiki/Wundef patch 02/04: replace with existing helper macros Signed-off-by: Andreas Mohr <and@gmx.li>
a b 14 14 15 15 /*** typedefs(not structures) and defined constants **********************************************/ 16 16 17 #ifdef S_ISREG 18 #define HAVE_S_ISREG 1 19 #else 20 #define HAVE_S_ISREG 0 21 #define S_ISREG(x) 0 22 #endif 23 24 #ifdef S_ISDIR 25 #define HAVE_S_ISDIR 1 26 #else 27 #define HAVE_S_ISDIR 0 28 #define S_ISDIR(x) 0 29 #endif 30 17 31 /* Replacement for permission bits missing in sys/stat.h */ 18 #ifndef S_ISLNK 32 #ifdef S_ISLNK 33 #define HAVE_S_ISLNK 1 34 #else 35 #define HAVE_S_ISLNK 0 19 36 #define S_ISLNK(x) 0 20 37 #endif 21 38 22 #ifndef S_ISSOCK 39 #ifdef S_ISSOCK 40 #define HAVE_S_ISSOCK 1 41 #else 42 #define HAVE_S_ISSOCK 0 23 43 #define S_ISSOCK(x) 0 24 44 #endif 25 45 26 #ifndef S_ISFIFO 46 #ifdef S_ISFIFO 47 #define HAVE_S_ISFIFO 1 48 #else 49 #define HAVE_S_ISFIFO 0 27 50 #define S_ISFIFO(x) 0 28 51 #endif 29 52 30 #ifndef S_ISCHR 53 #ifdef S_ISCHR 54 #define HAVE_S_ISCHR 1 55 #else 56 #define HAVE_S_ISCHR 0 31 57 #define S_ISCHR(x) 0 32 58 #endif 33 59 34 #ifndef S_ISBLK 60 #ifdef S_ISBLK 61 #define HAVE_S_ISBLK 1 62 #else 63 #define HAVE_S_ISBLK 0 35 64 #define S_ISBLK(x) 0 36 65 #endif 37 66 38 67 /* Door is something that only exists on Solaris */ 39 #ifndef S_ISDOOR 68 #ifdef S_ISDOOR 69 #define HAVE_S_ISDOOR 1 70 #else 71 #define HAVE_S_ISDOOR 0 40 72 #define S_ISDOOR(x) 0 41 73 #endif 42 74 43 75 /* Special named files are widely used in QNX6 */ 44 #ifndef S_ISNAM 76 #ifdef S_ISNAM 77 #define HAVE_S_ISNAM 1 78 #else 79 #define HAVE_S_ISNAM 0 45 80 #define S_ISNAM(x) 0 46 81 #endif 47 82 -
lib/filehighlight/get-color.c
a b 49 49 inline static gboolean 50 50 mc_fhl_is_file (file_entry_t * fe) 51 51 { 52 #if S_ISREG == 052 #if HAVE_S_ISREG == 0 53 53 (void) fe; 54 54 #endif 55 55 return S_ISREG (fe->st.st_mode); … … 64 64 inline static gboolean 65 65 mc_fhl_is_dir (file_entry_t * fe) 66 66 { 67 #if S_ISDIR == 067 #if HAVE_S_ISDIR == 0 68 68 (void) fe; 69 69 #endif 70 70 return S_ISDIR (fe->st.st_mode); … … 73 73 inline static gboolean 74 74 mc_fhl_is_link (file_entry_t * fe) 75 75 { 76 #if S_ISLNK == 076 #if HAVE_S_ISLNK == 0 77 77 (void) fe; 78 78 #endif 79 79 return S_ISLNK (fe->st.st_mode); … … 100 100 inline static gboolean 101 101 mc_fhl_is_device_char (file_entry_t * fe) 102 102 { 103 #if S_ISCHR == 0103 #if HAVE_S_ISCHR == 0 104 104 (void) fe; 105 105 #endif 106 106 return S_ISCHR (fe->st.st_mode); … … 109 109 inline static gboolean 110 110 mc_fhl_is_device_block (file_entry_t * fe) 111 111 { 112 #if S_ISBLK == 0112 #if HAVE_S_ISBLK == 0 113 113 (void) fe; 114 114 #endif 115 115 return S_ISBLK (fe->st.st_mode); … … 118 118 inline static gboolean 119 119 mc_fhl_is_special_socket (file_entry_t * fe) 120 120 { 121 #if S_ISSOCK == 0121 #if HAVE_S_ISSOCK == 0 122 122 (void) fe; 123 123 #endif 124 124 return S_ISSOCK (fe->st.st_mode); … … 127 127 inline static gboolean 128 128 mc_fhl_is_special_fifo (file_entry_t * fe) 129 129 { 130 #if S_ISFIFO == 0130 #if HAVE_S_ISFIFO == 0 131 131 (void) fe; 132 132 #endif 133 133 return S_ISFIFO (fe->st.st_mode); … … 136 136 inline static gboolean 137 137 mc_fhl_is_special_door (file_entry_t * fe) 138 138 { 139 #if S_ISDOOR == 0139 #if HAVE_S_ISDOOR == 0 140 140 (void) fe; 141 141 #endif 142 142