From b38313c518d99a43c8a2438ea20f1cf84636d794 Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:54:04 +1100 Subject: add handle def macro --- src/defines.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/defines.h') diff --git a/src/defines.h b/src/defines.h index 79b735d..52aa7b0 100644 --- a/src/defines.h +++ b/src/defines.h @@ -42,6 +42,13 @@ _Static_assert(sizeof(ptrdiff_t) == 8, ""); #define alignof(x) _Alignof(x) +// Wrap a u32 to make a type-safe "handle" or ID +#define CORE_DEFINE_HANDLE(name) \ + typedef struct name name; \ + struct name { \ + u32 raw; \ + } + /* Possible platform defines: #define CEL_PLATFORM_LINUX 1 -- cgit v1.2.3-70-g09d2