mirror of
https://github.com/Genymobile/scrcpy
synced 2024-11-18 21:26:07 +00:00
08f1fd46c8
This will allow to get the parent of an embedded struct.
15 lines
312 B
C
15 lines
312 B
C
#ifndef COMMON_H
|
|
#define COMMON_H
|
|
|
|
#include "config.h"
|
|
#include "compat.h"
|
|
|
|
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
|
|
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
|
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
|
|
|
#define container_of(ptr, type, member) \
|
|
((type *) (((char *) (ptr)) - offsetof(type, member)))
|
|
|
|
#endif
|