Ideally, I'd like to do something like
Code: Select all
structure st_t
a as byte
b as byte
c as byte
end structure
dim st as st_t
#if sizeof(st < 4)
#error "structure is too small"
#endif
Code: Select all
#define st_size = sizeof(st_t)
I also tried
Code: Select all
const st_size = sizeof(st) // can use sizeof() to init a const...
#if (st_size < 4)
#error "too small"
#endif
I've tried all sorts of methods using #defines, #const, etc, but I can't come up with one that lets the preprocessor "see" compile-time program declarations.