[sheepdog-users] [PATCH stable-0.8 04/22] sheep: fix some compile errors
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Mon Feb 24 08:06:52 CET 2014
From: Liu Yuan <namei.unix at gmail.com>
Both MIN/MAX and roundup are provided by glibc and would cause compile error
when we #include <sys/param.h>. Just use GNU version.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
include/util.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/util.h b/include/util.h
index 83f3c08..1932fe3 100644
--- a/include/util.h
+++ b/include/util.h
@@ -12,6 +12,7 @@
#include <urcu/uatomic.h>
#include <pthread.h>
#include <errno.h>
+#include <sys/param.h>
#include "logger.h"
#include "list.h"
@@ -20,7 +21,7 @@
#define SECTOR_SIZE (1U << 9)
#define BLOCK_SIZE (1U << 12)
-#define round_up(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define round_up(x, y) roundup(x, y)
#define round_down(x, y) (((x) / (y)) * (y))
#if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -53,9 +54,6 @@ static inline int after(uint32_t seq1, uint32_t seq2)
return (int32_t)(seq2 - seq1) < 0;
}
-#define MIN(x, y) ((x) > (y) ? (y) : (x))
-#define MAX(x, y) ((x) > (y) ? (x) : (y))
-
#define min(x, y) ({ \
typeof(x) _x = (x); \
typeof(y) _y = (y); \
--
1.7.10.4
More information about the sheepdog-users
mailing list