summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.c b/src/lib.c
index 063da23..0033463 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -1,5 +1,12 @@
#include "../include/al/lib.h"
+// https://forum.vcfed.org/index.php?threads/c-item-size-check-at-compile-time.1244920/
+#define AL_ASSERT_TYPE_SIZE(type, size) \
+ typedef char type##__size_test[( !!(sizeof(type) == size) )*2-1]
+
+AL_ASSERT_TYPE_SIZE(int, 4);
+AL_ASSERT_TYPE_SIZE(unsigned, 4);
+
#if AL_USE_STDLIB
static void *(*_al_malloc)(size_t) = malloc;
static void *(*_al_calloc)(size_t, size_t) = calloc;