ccp macro

CCPointExtension.h:55
@ #define ccp(X,Y) CCPointMake((float)X, (float)Y) @

To make it possible use ccp macro without @ using namespace cocos2d; @ please change it to
@ #define ccp(X,Y) cococs2d::CCPointMake((float)X, (float)Y) @

:slight_smile:

Thanks. It’s done https://github.com/cocos2d/cocos2d-x/commit/2bb4238a98731850eafbfdee2f034d49e23cad43

I think that this is still not ideal.

These defines are still polluting default namespace. I think that the best way is to embed them into namespaces as well. By the way you can specify namespace in the body of method.

class MyClass
{
public:
    cocos2d::CCPoint myMethod()
   {
          using namespace cocos2d;

          //Some magic

          return ccp(fooX, fooY);         
   }

};

macroses cannot be putted in namespaces :wink: no, to be correct i must say “of course it can be, but visibility of this macrodoesn’t change”