From e87efe74073938e6dea5f30654f6afb931da1e2c Mon Sep 17 00:00:00 2001 From: keithw Date: Wed, 21 Nov 2007 11:04:20 +0000 Subject: [pipe]: add Offset() util macro --- src/mesa/pipe/p_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h index 7897bc90e4..4002e2659f 100644 --- a/src/mesa/pipe/p_util.h +++ b/src/mesa/pipe/p_util.h @@ -114,6 +114,7 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size ) #define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) #define Elements(x) sizeof(x)/sizeof(*(x)) +#define Offset(TYPE, MEMBER) ((unsigned)&(((TYPE *)NULL)->MEMBER)) /** * Return a pointer aligned to next multiple of 16 bytes. -- cgit v1.2.3