Working with a piece of code right now that features declarations of the form:
typedef PACKED(struct)
{
// some stuff in here
} struct_name;
now…PACKED is a macro on our part. What the heck does this syntax mean? I don’t understand the use of parenthesis. This is not compiling, so I’m guessing this is probably incorrect. Is this close to some other valid syntax, or is it just nonsense?
If it is almost valid..how is this code actually supposed to be written and what is it supposed to mean?
The only form of typedef struct I’ve seen and can find online is:
typedef struct
{
// some stuff in here
} struct_name;
Solved: All I needed to realize was that struct was a parameter in a macro function. Thanks!
Usually something in all caps is a macro. In this case it’s probably supposed to decorate the struct declaration with the syntax for creating a packed structure, which will vary based on the compiler used.
Chances are you’re completely missing the definition of the PACKED macro.