Ticket #3430: mc-indroduct-wundef-check-03.patch

File mc-indroduct-wundef-check-03.patch, 2.4 KB (added by and, 10 years ago)
  • lib/unixcompat.h

    introduce -Wundef check to catch macro typos
    more infos about motivation at https://sourceware.org/glibc/wiki/Wundef
    
    patch 03/04: use #ifdef for autoconf provided marcos
    until autoconf switch from un/define marco logic to always existing macro with 0/1 value
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    1313 
    1414#include <sys/types.h>          /* BSD */ 
    1515 
    16 #if MAJOR_IN_MKDEV 
     16#ifdef MAJOR_IN_MKDEV 
    1717#include <sys/mkdev.h> 
    18 #elif MAJOR_IN_SYSMACROS 
     18#elif defined MAJOR_IN_SYSMACROS 
    1919#include <sys/sysmacros.h> 
    2020#endif 
    2121 
  • src/filemanager/filegui.c

    a b  
    5353#include <config.h> 
    5454 
    5555/* Keep this conditional in sync with the similar conditional in m4.include/mc-get-fs-info. */ 
    56 #if ((STAT_STATVFS || STAT_STATVFS64)                                       \ 
    57      && (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME \ 
    58          || (! HAVE_STRUCT_STATFS_F_FSTYPENAME))) 
     56#if ((defined STAT_STATVFS || defined STAT_STATVFS64)                                       \ 
     57     && (defined HAVE_STRUCT_STATVFS_F_BASETYPE || defined HAVE_STRUCT_STATVFS_F_FSTYPENAME \ 
     58         || (! defined HAVE_STRUCT_STATFS_F_FSTYPENAME))) 
    5959#define USE_STATVFS 1 
    6060#else 
    6161#define USE_STATVFS 0 
     
    8585#include <nfs/nfs_clnt.h> 
    8686#include <nfs/vfs.h> 
    8787#endif 
    88 #elif HAVE_OS_H                 /* BeOS */ 
     88#elif defined HAVE_OS_H                 /* BeOS */ 
    8989#include <fs_info.h> 
    9090#endif 
    9191 
     
    134134#endif 
    135135#endif 
    136136 
    137 #if HAVE_STRUCT_STATVFS_F_BASETYPE 
     137#ifdef HAVE_STRUCT_STATVFS_F_BASETYPE 
    138138#define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME f_basetype 
    139139#else 
    140 #if HAVE_STRUCT_STATVFS_F_FSTYPENAME || HAVE_STRUCT_STATFS_F_FSTYPENAME 
     140#if defined HAVE_STRUCT_STATVFS_F_FSTYPENAME || defined HAVE_STRUCT_STATFS_F_FSTYPENAME 
    141141#define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME f_fstypename 
    142 #elif HAVE_OS_H                 /* BeOS */ 
     142#elif defined HAVE_OS_H                 /* BeOS */ 
    143143#define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME fsh_name 
    144144#endif 
    145145#endif 
  • src/subshell.c

    diff -ruN a/src/subshell.c b/src/subshell.c
    a b  
    601601 
    602602#ifdef HAVE_POSIX_OPENPT 
    603603    pty_master = posix_openpt (O_RDWR); 
    604 #elif HAVE_GETPT 
     604#elif defined HAVE_GETPT 
    605605    /* getpt () is a GNU extension (glibc 2.1.x) */ 
    606606    pty_master = getpt (); 
    607 #elif IS_AIX 
     607#elif defined IS_AIX 
    608608    strcpy (pty_name, "/dev/ptc"); 
    609609    pty_master = open (pty_name, O_RDWR); 
    610610#else