From 54d4d7ef30e33c6708a6ae017979d0fed6c3ccf5 Mon Sep 17 00:00:00 2001 From: Tanmay Shah Date: Wed, 16 Aug 2023 12:18:47 -0700 Subject: [PATCH] lib: utilities: add MB and GB defines If MB and GB definition is not available then define new ones Signed-off-by: Tanmay Shah --- lib/utilities.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/utilities.h b/lib/utilities.h index 5ec6aeed..6b592e01 100644 --- a/lib/utilities.h +++ b/lib/utilities.h @@ -25,8 +25,13 @@ extern "C" { * @{ */ -#define MB (1024 * 1024UL) -#define GB (1024 * 1024 * 1024UL) +#ifndef MB +#define MB (1024UL << 10UL) +#endif + +#ifndef GB +#define GB (MB << 10UL) +#endif /** Marker for unused function arguments/variables. */ #define metal_unused(x) do { (x) = (x); } while (0)