From: keithw Date: Wed, 21 Nov 2007 11:04:20 +0000 (+0000) Subject: [pipe]: add Offset() util macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e87efe74073938e6dea5f30654f6afb931da1e2c;p=mesa.git [pipe]: add Offset() util macro --- diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h index 7897bc90e44..4002e2659fe 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.