mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
add container_of() macro
to be used to remove cast abuse and finding parent structs later Signed-off-by: Alejandro Mery <amery@geeks.cl>
This commit is contained in:
parent
7ef8855530
commit
ead8afe8a1
1 changed files with 6 additions and 0 deletions
|
@ -209,6 +209,12 @@ typedef unsigned __int64 u_int64_t;
|
|||
#include <endian.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef container_of
|
||||
#define container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M)))
|
||||
#endif
|
||||
|
||||
#if defined(__QNX__)
|
||||
#include <gulliver.h>
|
||||
#if defined(__LITTLEENDIAN__)
|
||||
|
|
Loading…
Add table
Reference in a new issue