From 77532b87db0ba09d21659250878e84eef000ac4c Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Tue, 14 May 2013 16:35:02 +0200 Subject: [PATCH] misc: Add macro for constant string lenght calculation during compile-time. --- src/misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/misc.h b/src/misc.h index c1d7f56..05c66b5 100644 --- a/src/misc.h +++ b/src/misc.h @@ -39,6 +39,10 @@ extern "C" { */ #define CR_UNUSED(x) (void)(x) +/** Lenght of static string (including last '\0' byte) + */ +#define CR_STATICSTRLEN(s) (sizeof(s)/sizeof(s[0])) + /** Convert flags from RPM header to a string representation. * @param flags flags * @return flags as constant string -- 2.7.4