1

I am trying to use the offsetof macro within another macro of my own, as follows:

#define MY_MACRO(struct_type, member)   \
  my_function(param1, offsetof(struct_type, member))

When I use my custom macro, the compiler complains that 'member' has not been declared. Is there a special way to parse structure member names into macros maybe?

I am using Microchip's XC32 compiler.

1 Answers1

0

I take my question back. My apologies for wasting space and time on this site. I had a sizeof() within my macro which was also looking for the sizeof the member which is causing the compile error.