aboutsummaryrefslogtreecommitdiffstats
path: root/src/steamvr_patches/include/layout.h
blob: 07d312f379f440497aa4d6e3a520b8f44060af29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* SPDX-FileCopyrightText: 2026 Tomasz Kramkowski <tomasz@kramkow.ski>
 * SPDX-License-Identifier: CC0-1.0
 */

#ifndef PATCH_LAYOUT_H
#define PATCH_LAYOUT_H

#include <stddef.h>

#define ASSERT_SIZE(type, expected) \
	_Static_assert(sizeof(type) == (expected), #type " size must be " #expected)
#define ASSERT_OFFSET(type, field, expected)                                    \
	_Static_assert(                                                         \
		offsetof(type, field) == (expected), #type "." #field " offset" \
	)

#endif