chiark / gitweb /
Reintroduce f_type comparison macro
[elogind.git] / src / shared / macro.h
index 9bf81dc3cc541229bebe333d8d3ee31074ffe68b..ac61b495883dc754f124010428e2b5e36302db78 100644 (file)
@@ -264,6 +264,13 @@ do {                                                                    \
         }                                                               \
 } while(false)
 
+ /* Because statfs.t_type can be int on some architecures, we have to cast
+  * the const magic to the type, otherwise the compiler warns about
+  * signed/unsigned comparison, because the magic can be 32 bit unsigned.
+ */
+#define F_TYPE_CMP(a, b) (a == (typeof(a)) b)
+
+
 /* Returns the number of chars needed to format variables of the
  * specified type as a decimal string. Adds in extra space for a
  * negative '-' prefix. */