From 1b4f888bc5be23563167eb056582e7567b832f0b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 6 Jul 2013 20:35:43 +0200 Subject: [PATCH] libdm: add DM_ARRAY_SIZE Add macro for reading detecting size of array. --- WHATS_NEW_DM | 1 + libdm/libdevmapper.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 4819a0b96..2fc454b62 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.78 - =================================== + Add DM_ARRAY_SIZE public macro. Move syslog code out of signal handle in dmeventd. Add DM_TO_STRING public macro. Always return success on dmeventd -V command call. diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 04345063b..66396cef3 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -38,6 +38,8 @@ #define DM_TO_STRING_EXP(A) #A #define DM_TO_STRING(A) DM_TO_STRING_EXP(A) +#define DM_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + #ifdef __cplusplus extern "C" { #endif