From dd75bacb781c8a902d4cade1ee4f1c5e9c72e8b0 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 13 Jun 2017 15:07:01 +0200 Subject: Move NUM_BYTES macro to core library It's universally useful so it make sense to have it in the shared core: * move macro from libosmocoding to libosmocore * add OSMO_ prefix * add doxygen docs Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02 --- include/osmocom/core/utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/osmocom/core/utils.h') diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 63a73ab4..1d1ebd8a 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -19,6 +19,8 @@ #define OSMO_STRINGIFY(x) #x /*! \brief Make a value_string entry from an enum value name */ #define OSMO_VALUE_STRING(x) { x, #x } +/*! \brief Number of bytes necessary to store given BITS */ +#define OSMO_BYTES_FOR_BITS(BITS) ((BITS + 8 - 1) / 8) #include #include -- cgit v1.2.3