diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |