summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-05-24 23:53:38 +0200
committerrobojumper <robojumper@gmail.com>2025-05-25 08:53:24 +0200
commita22eb87c36a5cb38ed544ba35bd3d15394e500a7 (patch)
tree0b7f44bcdc91cfd3c479e53ab4cf76187449c88a /include/common.h
parent04d5527ebab1a17348c5030dc21df481ed49b1c6 (diff)
make it build
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index 97a31a58..3dbf5b4d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -13,6 +13,7 @@
#define ROUND_DOWN_PTR(x, align) ((void *)(((u32)(x)) & (~((align) - 1))))
#define ARRAY_LENGTH(x) (sizeof((x)) / sizeof((x)[0]))
+#define BOOLIFY_TERNARY(expr_) ((expr_) ? 1 : 0)
#define CLEAR_PATH(x) __memclr((x), sizeof((x)))
@@ -49,6 +50,10 @@
#define __alloca(x) ((void *)x)
#endif
+#define ATTR_FALLTHROUGH
+#define ATTR_UNUSED
+#define ATTR_MAYBE_UNUSED
+
#ifdef NON_MATCHING
#define DECOMP_FORCEACTIVE(module, ...)
#define DECOMP_FORCELITERAL(module, x)
@@ -60,6 +65,25 @@
#define __CONCAT(x, y) x##y
#define CONCAT(x, y) __CONCAT(x, y)
+#define STR_(x) #x
+#define STR(x) STR_(x)
+
+#ifndef alignas
+# define alignas ATTR_ALIGN
+#endif
+
+#ifndef decltype
+# define decltype __decltype__
+#endif
+
+#ifndef static_assert
+# define static_assert __static_assert
+#endif
+
+#ifndef typeof
+# define typeof __typeof__
+#endif
+
#define DECOMP_FORCEACTIVE(module, ...) \
void fake_function(...); \
void CONCAT(FORCEACTIVE##module, __LINE__)(void); \