From 3b39a8a9f1c114ad5fbfca47d6f6949ea42e95ac Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Sat, 7 Dec 2013 09:59:13 -0800 Subject: [PATCH] librbd: rename howmany to avoid conflict A howmany macro exists on some platforms in standard headers, but there really isn't any sort of standard that I've found. We just avoid the conflict entirely this way. Signed-off-by: Noah Watkins --- src/librbd/internal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 4185f36b18157..f7899053a3754 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -28,7 +28,7 @@ #undef dout_prefix #define dout_prefix *_dout << "librbd: " -#define howmany(x, y) (((x) + (y) - 1) / (y)) +#define rbd_howmany(x, y) (((x) + (y) - 1) / (y)) using std::map; using std::pair; @@ -119,7 +119,7 @@ namespace librbd { ictx->snap_lock.put_read(); ictx->md_lock.put_read(); info.obj_size = 1ULL << obj_order; - info.num_objs = howmany(info.size, ictx->get_object_size()); + info.num_objs = rbd_howmany(info.size, ictx->get_object_size()); info.order = obj_order; memcpy(&info.block_name_prefix, ictx->object_prefix.c_str(), min((size_t)RBD_MAX_BLOCK_NAME_SIZE, -- 2.39.5