August 25, 200421 yr Ok, I'm doing my homework and studying the header (with Arne's improvements), and I see this part below: #define ELEMENT_INFO ELEMENT_TYPE_ENUM element_type; ID resource_id; PIXPOINT position; PIXPOINT previous_position; PIXPOINT ofs; PGAUGEHDR gauge_header; struct ELEMENT_HEADER *previous_element; struct ELEMENT_HEADER **next_element; PFAILURE_RECORD failure_systems; FLAGS image_flags; FLAGS aircraft_special_instrumentation; FLAGS reserved;typedef struct ELEMENT_HEADER{ ELEMENT_INFO}ELEMENT_HEADER;#define HEADER union { struct { ELEMENT_INFO }; ELEMENT_HEADER header; } It seems this HEADER macro is redundant. Any thoughts as to why, or do I need to review my cpp preprocessor tokenization again? =)
August 25, 200421 yr I finally understand what MS was doing here. Basically, they were trying to create a new Type within the limits of C.This macro gives them the same functionality as a C++ anonymous union, which isn't available in C.
Create an account or sign in to comment