]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib/compat.h: Remove workardound for dev_t comparisons
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 13 Jun 2022 13:10:53 +0000 (15:10 +0200)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 4 Jul 2022 09:53:48 +0000 (11:53 +0200)
dev_t is defined by POSIX to be a number, and all supported systems
define major() and minor() at one place or the other, thus this commit
removes the workarounds.

configure.ac
m4/typeof_dev_t.m4 [deleted file]
src/lib/compat.h

index 86844870a18006513b1be91a8a125816d781a85b..128ea2c0e6d4de083635d03885080e4ecc953d8c 100644 (file)
@@ -425,8 +425,6 @@ AC_C_FLEXIBLE_ARRAY_MEMBER
 
 DOVECOT_IOVEC
 
-DOVECOT_TYPEOF_DEV_T
-
 DOVECOT_RLIMIT_AS
 DOVECOT_RLIMIT_NPROC
 DOVECOT_RLIMIT_CORE
diff --git a/m4/typeof_dev_t.m4 b/m4/typeof_dev_t.m4
deleted file mode 100644 (file)
index 4fce9df..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl * is dev_t an integer or something else?
-AC_DEFUN([DOVECOT_TYPEOF_DEV_T], [
-  AC_CACHE_CHECK([whether dev_t is struct],i_cv_dev_t_struct,[
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-      #include <sys/types.h>
-      struct test { dev_t a; };
-      static struct test t = { 0 };
-    ]],
-    [[ ]])], [
-      i_cv_dev_t_struct=no
-    ],[
-      i_cv_dev_t_struct=yes
-    ])
-  ])
-  AS_IF([test $i_cv_dev_t_struct = yes], [
-    AC_DEFINE(DEV_T_STRUCT,, [Define if your dev_t is a structure instead of integer type])
-  ])
-]) 
index 82aa1fa831fefb2e3780315b03ee1733a7b80792..a7dd66d658e2763deead365fbeaacc69924c747e 100644 (file)
@@ -71,26 +71,10 @@ typedef unsigned long long uoff_t;
 #  undef WORDS_BIGENDIAN
 #endif
 
-/*
- *
- *
- *
- * POSIX.1-2001
- *
- *
- *
- */
 #ifdef HAVE_SYS_SYSMACROS_H
 #  include <sys/sysmacros.h>
-#  ifdef HAVE_SYS_MKDEV_H
-#    include <sys/mkdev.h> /* UnixWare */
-#  endif
-#  define CMP_DEV_T(a, b) (major(a) == major(b) && minor(a) == minor(b))
-#elif !defined (DEV_T_STRUCT)
-#  define CMP_DEV_T(a, b) ((a) == (b))
-#else
-#  error I do not know how to compare dev_t
 #endif
+#define CMP_DEV_T(a, b) (major(a) == major(b) && minor(a) == minor(b))
 
 #ifdef HAVE_STAT_XTIM
 #  define HAVE_ST_NSECS