diff src/lib/compat.h @ 692:359f73bf84b5 HEAD

Added CMP_DEV_T macro which uses major()/minor() if possible but fallbacks to direct comparing if it's not a structure.
author Timo Sirainen <tss@iki.fi>
date Tue, 26 Nov 2002 21:01:24 +0200
parents 1e5c655bad25
children 21233287e9c1
line wrap: on
line diff
--- a/src/lib/compat.h	Tue Nov 26 20:47:43 2002 +0200
+++ b/src/lib/compat.h	Tue Nov 26 21:01:24 2002 +0200
@@ -29,6 +29,14 @@
 typedef int socklen_t;
 #endif
 
+#ifdef HAVE_SYS_SYSMACROS_H
+#  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
+
 /* memmove() */
 #ifndef HAVE_MEMMOVE
 #  define memmove my_memmove