diff options
-rw-r--r-- | include/pso/TMainTask.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h index e299006..c2cfbfa 100644 --- a/include/pso/TMainTask.h +++ b/include/pso/TMainTask.h @@ -5,20 +5,24 @@ #include "pso/macros.h" #include "pso/TObject.h" -#define SET_OR_CLEAR_CHILD_FLAGS(flags, old_flags, flag_bit) \ + +#define X_OR_Y_CHILD(flags, old_flags, one_prefix, zero_prefix, suffix) \ if (flags != old_flags) { \ TMainTask *child; \ u32 bit = 1; \ FOREACH_NODE_NODECL_MULTI_ITER(TMainTask, main_task.down, child, bit <<= 1) { \ if (main_task_flags & bit) { \ - child->set_flag_##flag_bit(); \ + child->one_prefix##_##suffix(); \ } else { \ - child->clear_flag_##flag_bit(); \ + child->zero_prefix##_##suffix(); \ } \ } \ old_flags = flags; \ } +#define SET_OR_CLEAR_CHILD_FLAGS(flags, old_flags, flag_bit) \ + X_OR_Y_CHILD(flags, old_flags, set_flag, clear_flag, flag_bit) + #define o(var, name) extern const char *var##_name; TL_OBJECTS #undef o |