diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-04-01 09:36:22 -0700 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-04-01 14:35:54 -0700 |
commit | 6aaf5c113f4c282d5900baddb699e3acc9bff12c (patch) | |
tree | 62491525efd03326c44f68f35e898e0bb2d5d205 /include | |
parent | e34895f76037b8faff0646fa4e953bae4491497c (diff) |
libwimaxll: make wimaxll_container_of() available for all
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/wimaxll.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/wimaxll.h b/include/wimaxll.h index d44da2c..f8b2668 100644 --- a/include/wimaxll.h +++ b/include/wimaxll.h @@ -352,6 +352,13 @@ const char * wimaxll_state_to_name(enum wimax_st); #define wimaxll_array_size(a) (sizeof(a)/sizeof(a[0])) +#define wimaxll_container_of(pointer, type, member) \ +({ \ + type *object = NULL; \ + size_t offset = (void *) &object->member - (void *) object; \ + (type *) ((void *) pointer - offset); \ +}) + static inline // ugly hack for doxygen /** * |