Ok, I'm dumb, byte alignment for the third time
salem let me explain, I went to delete the FIRST thread I made on byte alignment after I realized I posted two threads on the same topic (I forgot I made the first). Then, I couldn't find the most recent one I made so I assume you deleted it, now none exist but I still need to understand what this means.
Anyway I know that PACK_STRUCT expands to nothing, but I don't know what the rest of those '#' directives mean, and I would like someone to tell me. I don't know what the pack/push __attribute__((packed)) lines mean. When I just include the structures without the defines the application doesn't work properly.
yeah well salem don't beat me up plz
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
#elif defined( __GNUC__ )
# define PACK_STRUCT __attribute__((packed))
# error you must byte-align these structures with the appropriate compiler directives
typedef unsigned char byte;
typedef unsigned short word;
// File header
....//MORE STRUCTS THAT DON'T NEED TO TAKE UP SPACE
// Default alignment
# pragma pack( pop, packing )