summaryrefslogtreecommitdiff
path: root/include/libHX/cast.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2024-02-26 09:59:29 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2024-02-26 09:59:29 +0100
commitc2476ff6a5966e61956edb2d208fed140ae7cf55 (patch)
tree8fec731deb3b43e93521e6433752163a2726e9b5 /include/libHX/cast.h
parent461d481e1a84e8e5232b471331e02ea9d63b2a2a (diff)
parent92ac2277ef889d82e56efd57a342959d8b3399d8 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'include/libHX/cast.h')
-rw-r--r--include/libHX/cast.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libHX/cast.h b/include/libHX/cast.h
index cb2cba5..c8fe0ba 100644
--- a/include/libHX/cast.h
+++ b/include/libHX/cast.h
@@ -1,6 +1,12 @@
#ifndef _LIBHX_CAST_H
#define _LIBHX_CAST_H 1
+#ifndef BUILD_BUG_ON_EXPR
+# define BUILD_BUG_ON_EXPR(condition) (sizeof(char[1 - 2 * !!(condition)]) - 1)
+#endif
+#ifndef BUILD_BUG_ON
+# define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_EXPR(condition))
+#endif
#ifdef __cplusplus
# ifndef const_cast
# define const_cast(T, x) const_cast<T>(x)