New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicit namespace qualifier is missing in macro definitions in CCObject.h #867
Comments
All engine codes are qualified in name space cocos2d, you should use the name space to invoke any engine codes. So is it needed? |
After expanding macros in user code their content is NOT in predictable context or namespace.
I cannot qualify the macro with namespace. I forced to import namespace, because i cannot say something like that
I think the opposite question should be asked :) Is there any reason to NOT specify namepace in macro definition? Well-known libraries (Boost for example) do always specify full “namespace path” to their identifiers in macro definitions. It's written once, and used frequently, so why not to do this? |
Yeap, you are right. Thank you. |
remote 3d related modules
Macro definitions should involve full namespace qualification (to be independent from usage context).
Expected:
#define schedule_selector(_SELECTOR) (::cocos2d::SEL_SCHEDULE)(&_SELECTOR)
or even preferable
#define schedule_selector(_SELECTOR) static_cast<::cocos2d::SEL_SCHEDULE>(&_SELECTOR)
Actual:
#define schedule_selector(_SELECTOR) (SEL_SCHEDULE)(&_SELECTOR)
The latter causes a compilation error if namespace cocos2d is not imported in user's code (to prevent namespace pollution for example):
The text was updated successfully, but these errors were encountered: