12.08.2025, 20:26
mir ist noch aufgefallen das in der src/gen/hero.h die packings nicht gleichmaessig sind - clang hat da eine Warnung ausgespuckt
wäre es nicht besser solche PACK_BEGIN/END macros zu machen?
wichtig - das Semikolon muss ans Ende von PACK_END
wäre es nicht besser solche PACK_BEGIN/END macros zu machen?
Code:
#if defined(_MSC_VER)
#define PACK_BEGIN __pragma(pack(push, 1))
#define PACK_END __pragma(pack(pop))
#elif defined(__GNUC__)
#define PACK_BEGIN
#define PACK_END __attribute__((packed))
#else
#error "Compiler not supported"
#endif
PACK_BEGIN
struct struct_attribs {
signed char normal;
signed char current;
signed char mod;
}
PACK_END;
....
wichtig - das Semikolon muss ans Ende von PACK_END