define some more utility functionality

This commit is contained in:
2025-06-18 13:24:04 +02:00
parent d28b0189c2
commit 6a10122858
3 changed files with 28 additions and 11 deletions

9
src/util/macro.h Normal file
View File

@@ -0,0 +1,9 @@
// Copyright (c) 2025 Quinn
// Licensed under the MIT Licence. See LICENSE for details
#pragma once
#define MACRO_WIDTH(t) (sizeof(t) * 8) // gets the bit width of a type
#define MACRO_CAT(x, y) x##y // concatenate two macro variables together
#define MACRO_CAT2(x, y) MACRO_CAT(x, y) // concatenate two macro variables together
#define MACRO_STR(v) #v // for converting macro variable into a string
#define MACRO_STR2(v) MACRO_STR(v) // for a recursive string generation