ccp macro

ccp macro
0.0 0


@ #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) @



Thanks. It’s done


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
    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”