chiark / gitweb /
shared: add MIN3 macro
[elogind.git] / src / shared / macro.h
index 32cf714857809b5ec591cd484c9e1c0671654529..70c5fb50a74b9ab49a9eb4823a8fd9e3f4be884f 100644 (file)
@@ -154,6 +154,12 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
                         _a < _b ? _a : _b;      \
                 })
 
+#define MIN3(x,y,z)                              \
+        __extension__ ({                         \
+                        typeof(x) _c = MIN(x,y); \
+                        MIN(_c, z);              \
+                })
+
 #define LESS_BY(A,B)                            \
         __extension__ ({                        \
                         typeof(A) _A = (A);     \