issue #2217: Revert changes in CCPlatformMacro.h.

This commit is contained in:
James Chen 2013-05-23 15:59:45 +08:00
parent 22e259360e
commit 733b551bf6
1 changed files with 9 additions and 19 deletions

View File

@ -119,13 +119,11 @@ It's new in cocos2d-x since v0.99.5
*/
#define CC_PROPERTY_READONLY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void);\
protected:
public: virtual varType get##funName(void);
#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void);\
protected:
public: virtual const varType& get##funName(void);
/** CC_PROPERTY is used to declare a protected variable.
We can use getter to read the variable, and use the setter to change the variable.
@ -140,14 +138,12 @@ protected:
#define CC_PROPERTY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void);\
public: virtual void set##funName(varType var);\
protected:
public: virtual void set##funName(varType var);
#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void);\
public: virtual void set##funName(const varType& var);\
protected:
public: virtual void set##funName(const varType& var);
/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
We can use getter to read the variable.
@ -160,13 +156,11 @@ protected:
*/
#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void) const { return varName; }\
protected:
public: virtual varType get##funName(void) const { return varName; }
#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void) const { return varName; }\
protected:
public: virtual const varType& get##funName(void) const { return varName; }
/** CC_SYNTHESIZE is used to declare a protected variable.
We can use getter to read the variable, and use the setter to change the variable.
@ -181,14 +175,12 @@ protected:
#define CC_SYNTHESIZE(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void) const { return varName; }\
public: virtual void set##funName(varType var){ varName = var; }\
protected:
public: virtual void set##funName(varType var){ varName = var; }
#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void) const { return varName; }\
public: virtual void set##funName(const varType& var){ varName = var; }\
protected:
public: virtual void set##funName(const varType& var){ varName = var; }
#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \
private: varType varName; \
@ -201,9 +193,7 @@ public: virtual void set##funName(varType var) \
CC_SAFE_RELEASE(varName); \
varName = var; \
} \
} \
protected:
}
#define CC_SAFE_DELETE(p) do { if(p) { delete (p); (p) = 0; } } while(0)
#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = 0; } } while(0)