make selectors use variadic arguments

- this fixes using templated functions as callbacks
This commit is contained in:
HJfod 2022-12-12 12:49:14 +02:00
parent 3897293862
commit 4e6559966f

View file

@ -173,14 +173,14 @@ typedef void (CCObject::*SEL_MenuHandler)(CCObject*);
typedef void (CCObject::*SEL_EventHandler)(CCEvent*);
typedef int (CCObject::*SEL_Compare)(CCObject*);
#define schedule_selector(_SELECTOR) (cocos2d::SEL_SCHEDULE)(&_SELECTOR)
#define callfunc_selector(_SELECTOR) (cocos2d::SEL_CallFunc)(&_SELECTOR)
#define callfuncN_selector(_SELECTOR) (cocos2d::SEL_CallFuncN)(&_SELECTOR)
#define callfuncND_selector(_SELECTOR) (cocos2d::SEL_CallFuncND)(&_SELECTOR)
#define callfuncO_selector(_SELECTOR) (cocos2d::SEL_CallFuncO)(&_SELECTOR)
#define menu_selector(_SELECTOR) (cocos2d::SEL_MenuHandler)(&_SELECTOR)
#define event_selector(_SELECTOR) (cocos2d::SEL_EventHandler)(&_SELECTOR)
#define compare_selector(_SELECTOR) (cocos2d::SEL_Compare)(&_SELECTOR)
#define schedule_selector(...) (cocos2d::SEL_SCHEDULE)(&__VA_ARGS__)
#define callfunc_selector(...) (cocos2d::SEL_CallFunc)(&__VA_ARGS__)
#define callfuncN_selector(...) (cocos2d::SEL_CallFuncN)(&__VA_ARGS__)
#define callfuncND_selector(...) (cocos2d::SEL_CallFuncND)(&__VA_ARGS__)
#define callfuncO_selector(...) (cocos2d::SEL_CallFuncO)(&__VA_ARGS__)
#define menu_selector(...) (cocos2d::SEL_MenuHandler)(&__VA_ARGS__)
#define event_selector(...) (cocos2d::SEL_EventHandler)(&__VA_ARGS__)
#define compare_selector(...) (cocos2d::SEL_Compare)(&__VA_ARGS__)
// end of base_nodes group
/// @}