aboutsummaryrefslogtreecommitdiff
path: root/include/util/util.h
blob: ed1102bc89f8c8883653f3cea56f46469dabb560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
 * util.h
 *
 * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
 */
#ifndef UTIL_H
#define UTIL_H

#include "config.h"
#include "sqfs/predef.h"

#include <stdint.h>
#include <stddef.h>

#include "compat.h"

#define container_of(ptr, type, member) \
	((type *)((char *)ptr - offsetof(type, member)))

#endif /* UTIL_H */