make it compile on zig compier

cannot access null field members, also cannot access field that is
misaligned. pretend there is something at high multiple of 2 value to
future proof to stupid degree and stop the zig compiler from complaining
about the cool hack
This commit is contained in:
2026-02-26 20:26:05 +01:00
parent 0f7f092ad3
commit 24dd5250f8
+1 -1
View File
@@ -9,7 +9,7 @@
#include <string.h>
typedef union any_align { char c; int i; long l; long long ll; float f; double d; void *p; long double ld; } any_align_t;
#define ALIGN_OF(TYPE) ((size_t)(&((struct{char c; TYPE t;}*) 0)->t))
#define ALIGN_OF(TYPE) ((size_t)(&((struct{char c; TYPE t;}*) 256)->t) - 256)
#define MAX_ALIGN (ALIGN_OF(any_align_t))
#define KB (1024)
#define MB (KB * KB)