Better static assert

This commit is contained in:
Jōshin 2023-12-04 12:42:10 -05:00
parent f8505690e3
commit 44da6d670a
No known key found for this signature in database

View file

@ -203,11 +203,11 @@ struct PathSearcher {
unsigned long namelen;
const char *name;
const char *syspath;
char varname[VARSIZE]; // stores "$VARNAME=". must immediately precede path.
char varname[VARSIZE];
char path[PATHSIZE];
};
_Static_assert(sizeof(struct PathSearcher) == PATHSIZE + 64,
"struct layout");
_Static_assert(offsetof(struct PathSearcher, varname) + VARSIZE ==
offsetof(struct PathSearcher, path), "struct layout");
struct ApeLoader {
struct PathSearcher ps;