aboutsummaryrefslogtreecommitdiffstats
path: root/src/steamvr_patches/include/layout.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/steamvr_patches/include/layout.h')
-rw-r--r--src/steamvr_patches/include/layout.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/steamvr_patches/include/layout.h b/src/steamvr_patches/include/layout.h
new file mode 100644
index 0000000..07d312f
--- /dev/null
+++ b/src/steamvr_patches/include/layout.h
@@ -0,0 +1,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