From 2c5af590ddbb08e0a46b7e37c5f0230b1805cd37 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Thu, 20 Nov 2014 12:19:47 -0800 Subject: Refactor ARRAY_LENGTH macro definitions in test code --- boilerplate/cairo-boilerplate.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'boilerplate/cairo-boilerplate.h') diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h index 4f6b8fde9..515bb03bc 100644 --- a/boilerplate/cairo-boilerplate.h +++ b/boilerplate/cairo-boilerplate.h @@ -94,6 +94,10 @@ #define M_PI 3.14159265358979323846 #endif +#ifndef ARRAY_LENGTH +#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0]))) +#endif + CAIRO_BEGIN_DECLS /* A fake format we use for the flattened ARGB output of the PS and -- cgit v1.2.1