[mpp_common]: Add container_of macro

Include <stddef.h> and add container_of macro.

Change-Id: Ie439b7683e026be9336e618c605b3b934e4fde38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2020-03-12 15:50:03 +08:00
parent 512de40ff0
commit 22aef2ccd3

View File

@@ -148,11 +148,14 @@
#define fseeko fseeko64
#else
#include <unistd.h>
#include <stddef.h>
#include <sys/stat.h>
#include <sys/types.h>
#define mkdir(x) mkdir(x, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
#endif
#define container_of(ptr, type, member) \
((type *)((char *)(ptr) - offsetof(type, member)))
#define __RETURN __Return
#define __FAILED __failed