OSDN Git Service

Switch to using the standard autoconf AC_HEADER_MAJOR macro
authorJean-Pierre André <jpandre@users.sourceforge.net>
Tue, 31 May 2016 06:33:10 +0000 (08:33 +0200)
committerJean-Pierre André <jpandre@users.sourceforge.net>
Tue, 31 May 2016 06:33:10 +0000 (08:33 +0200)
Switch to the standard autoconf AC_HEADER_MAJOR macro which takes care
of the ugly details like when to use mkdev.h and when to use sysmacros.h.
(requires <sys/types.h> to be included)
Also include these in all files that use major/minor/makedev funcs.

(Contributed by Mike Frysinger)

configure.ac
libfuse-lite/fuse_lowlevel.c
libntfs-3g/dir.c
libntfs-3g/ioctl.c
src/lowntfs-3g.c
src/ntfs-3g.c

index 644ae00..1f96263 100644 (file)
@@ -473,12 +473,13 @@ fi
 
 # Checks for header files.
 AC_HEADER_STDC
+AC_HEADER_MAJOR
 AC_CHECK_HEADERS([ctype.h fcntl.h libgen.h libintl.h limits.h locale.h \
        mntent.h stddef.h stdint.h stdlib.h stdio.h stdarg.h string.h \
        strings.h errno.h time.h unistd.h utime.h wchar.h getopt.h features.h \
        regex.h endian.h byteswap.h sys/byteorder.h sys/disk.h sys/endian.h \
-       sys/param.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/stat.h sys/types.h \
-       sys/vfs.h sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h \
+       sys/param.h sys/ioctl.h sys/mount.h sys/stat.h sys/types.h \
+       sys/vfs.h sys/statvfs.h linux/major.h linux/fd.h \
        linux/fs.h inttypes.h linux/hdreg.h \
        machine/endian.h windows.h syslog.h pwd.h malloc.h])
 
index e9d7d7a..7dfcb64 100644 (file)
 #include <limits.h>
 #include <errno.h>
 
-#if defined(__sun) && defined (__SVR4)
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
-#endif /* defined(__sun) && defined (__SVR4) */
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #define PARAM(inarg) (((const char *)(inarg)) + sizeof(*(inarg)))
 #define OFFSET_MAX 0x7fffffffffffffffLL
index b9f73aa..ce69eaf 100644 (file)
 #include <sys/stat.h>
 #endif
 
-#if defined(__sun) && defined (__SVR4)
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
-#else /* defined(__sun) && defined (__SVR4) */
-#ifdef HAVE_SYS_SYSMACROS_H
+#ifdef MAJOR_IN_SYSMACROS
 #include <sys/sysmacros.h>
 #endif
-#endif /* defined(__sun) && defined (__SVR4) */
 
 #include "param.h"
 #include "types.h"
index c350164..28532b2 100644 (file)
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
index 5439b10..08529a4 100644 (file)
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #if defined(__APPLE__) || defined(__DARWIN__)
 #include <sys/dirent.h>
index 6b25f03..640cfc4 100644 (file)
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #if defined(__APPLE__) || defined(__DARWIN__)
 #include <sys/dirent.h>