rt/include/rt/container.h

16 lines
261 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define rt_container_of(ptr, type, member) \
((type *)((uintptr_t)(ptr)-offsetof(type, member)))
#ifdef __cplusplus
}
#endif