determine the packed attribute of a struct before generating its fields