mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
14 lines
243 B
C
14 lines
243 B
C
|
#ifndef WF_CONTAINER_OF_H
|
||
|
#define WF_CONTAINER_OF_H
|
||
|
|
||
|
#ifndef __cplusplus
|
||
|
#include <stddef.h>
|
||
|
#else
|
||
|
#include <cstddef>
|
||
|
#endif
|
||
|
|
||
|
#define WF_CONTAINER_OF(pointer, type, member) \
|
||
|
(type *) (((char *) pointer) - offsetof(type, member))
|
||
|
|
||
|
#endif
|