Skip to content

Add compile-time checks for Dehacked table length.

Golden requested to merge Golden/SRB2:better-deh-tablecheck into next
Checking dependency files...
-- deh_tables.c ... 
-- comptime.c ...
deh_tables.c: In function ‘DEH_TableCheck’:
deh_tables.c:5486:56: error: size of unnamed array is negative
  #define DEH_CHECKTABLE(table, size) ((void)sizeof(char[1 - 2*!!((sizeof(table)/sizeof(const char*)) != size)]))
                                                        ^
deh_tables.c:5491:2: note: in expansion of macro ‘DEH_CHECKTABLE’
  DEH_CHECKTABLE(COLOR_ENUMS, SKINCOLOR_FIRSTFREESLOT); // If your build fails here, you forgot to update COLOR_ENUMS!
  ^~~~~~~~~~~~~~
make: *** [Makefile:746: ../objs/Linux64/SDL/Release/deh_tables.o] Error 1

Not targetted for master because of the dehacked split..
Hope you guys don't mind.

Merge request reports