Skip to content

Commit

Permalink
Fixed listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayuto committed Jun 21, 2020
1 parent 3572be4 commit 2c9c421
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/modules/listeners/listeners_manager.h
Expand Up @@ -47,25 +47,25 @@
// Calls all listeners of the given manager
#define CALL_LISTENERS(name, ...) \
extern CListenerManager* Get##name##ListenerManager(); \
CALL_LISTENERS_WITH_MNGR(Get##name##ListenerManager(), ##__VA_ARGS__)
CALL_LISTENERS_WITH_MNGR(Get##name##ListenerManager(), __VA_ARGS__)

#define CALL_LISTENERS_WITH_MNGR(mngr, ...) \
for(int i = 0; i < mngr->m_vecCallables.Count(); i++) \
{ \
BEGIN_BOOST_PY() \
mngr->m_vecCallables[i]( #__VA_ARGS__ ); \
mngr->m_vecCallables[i]( __VA_ARGS__ ); \
END_BOOST_PY_NORET() \
}

#define FOREACH_CALLBACK(name, return_var, action, ...) \
extern CListenerManager* Get##name##ListenerManager(); \
FOREACH_CALLBACK_WITH_MNGR(Get##name##ListenerManager(), return_var, action, ##__VA_ARGS__)
FOREACH_CALLBACK_WITH_MNGR(Get##name##ListenerManager(), return_var, action, __VA_ARGS__)

#define FOREACH_CALLBACK_WITH_MNGR(mngr, return_var, action, ...) \
for(int i = 0; i < mngr->m_vecCallables.Count(); i++) \
{ \
BEGIN_BOOST_PY() \
return_var = mngr->m_vecCallables[i]( #__VA_ARGS__ ); \
return_var = mngr->m_vecCallables[i]( __VA_ARGS__ ); \
action \
END_BOOST_PY_NORET() \
}
Expand Down

0 comments on commit 2c9c421

Please sign in to comment.