This is a part of code that I'm trying to understand but I can't understand how a macro like this works. The first line #define FOREACH_OMPD_STATE(macro) defines a function_like Macro that has a parameter named 'macro' but what does the rest of the definition mean?
#define FOREACH_OMPD_STATE(macro) \
\
/* first available state */ \
macro (ompt_state_undefined, 0x102) /* undefined thread state */ \
\
/* work states (0..15) */ \
macro (ompt_state_work_serial, 0x000) /* working outside parallel */ \
macro (ompt_state_work_parallel, 0x001) /* working within parallel */ \
macro (ompt_state_work_reduction, 0x002) /* performing a reduction */
Are those different values for the parameter named macro or what?