I wanna pass NULL to the 4th param of the following function:
bool CCMenuItemToggle::initWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, **va_list args**);
like this:
CCMenuItemToggle::initWithTarget(this, menu_selector(GOSound::toggleButtonCallback), NULL, NULL);
It's ok when I build it in XCode (clang3.1). But when I port the code to android ndk (g++4.7), it fails to compile:
no viable conversion from 'int' to 'va_list' (aka '__builtin_va_list')
How should I deal with it?
I assume your code will work if you just use an empty va_list
instead of NULL.
CCMenuItemToggle::initWithTarget( this, menu_selector(GOSound::toggleButtonCallback)
, NULL, va_list() );
Edit: Maybe this alternative solution works with both compilers.
va_list empty_va_list = va_list();
CCMenuItemToggle::initWithTarget( this, menu_selector(GOSound::toggleButtonCallback)
, NULL, empty_va_list );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With