From c5841193570edf6eca119c583d9e790eef12dcb1 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 22 Mar 2011 10:57:31 +0000 Subject: introduce nitems macro, with the appropriate ifndef. ok oga@ --- calmwm.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'calmwm.h') diff --git a/calmwm.h b/calmwm.h index 59da0f1..0f9b18b 100644 --- a/calmwm.h +++ b/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.h,v 1.121 2011/03/22 10:52:37 okan Exp $ + * $Id: calmwm.h,v 1.122 2011/03/22 10:57:31 okan Exp $ */ #ifndef _CALMWM_H_ @@ -51,6 +51,10 @@ PointerMotionMask) #define SearchMask (KeyPressMask|ExposureMask) +#ifndef nitems +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + enum cwmcolor { CWM_COLOR_BORDOR_ACTIVE, CWM_COLOR_BORDER_INACTIVE, -- cgit v1.2.3-2-gb3c3