summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe/p_util.h')
-rw-r--r--src/gallium/include/pipe/p_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h
index d3b2fa29507..283f7fb8f5d 100644
--- a/src/gallium/include/pipe/p_util.h
+++ b/src/gallium/include/pipe/p_util.h
@@ -201,7 +201,7 @@ mem_dup(const void *src, uint size)
#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
-#define Elements(x) sizeof(x)/sizeof(*(x))
+#define Elements(x) (sizeof(x)/sizeof((x)[0]))
#define Offset(TYPE, MEMBER) ((unsigned)&(((TYPE *)NULL)->MEMBER))
/**