ソースを参照

Rename ZERO and IDENTITY in BsFwdDeclUtil.h

With g++ and clang++, there is a name conflict between enum
BansheeEngine::ZERO and values like Vector3::ZERO:

    warning: declaration of ‘const BansheeEngine::Vector3 BansheeEngine::Vector3::ZERO’ [-fpermissive]
        static const Vector3 ZERO;
                             ^
    warning: changes meaning of ‘ZERO’ from ‘enum BansheeEngine::ZERO’ [-fpermissive]
        enum ZERO { BsZero };
             ^

The same issue happens with enum BansheeEngine::IDENTITY.  This commit
renames the enums defined in BsFwdDeclUtil.h to solve this problem:
- ZERO becomes BS_ZERO
- IDENTITY becomes BS_IDENTITY
Marc Legendre 9 年 前
コミット
15608f9dc9

+ 3 - 3
Source/BansheeUtility/Include/BsFwdDeclUtil.h

@@ -22,10 +22,10 @@ namespace BansheeEngine
 	};
 
 	/** Enum used for object construction specifying the object should be zero initializes. */
-	enum ZERO { BsZero };
+	enum BS_ZERO { BsZero };
 
 	/** Enum used for matrix/quaternion constructor specifying it should be initialized with an identity value. */
-	enum IDENTITY { BsIdentity };
+	enum BS_IDENTITY { BsIdentity };
 
 	/** @} */
 
@@ -121,4 +121,4 @@ namespace BansheeEngine
 		TID_Flags = 68,
 		TID_IReflectable = 69
 	};
-}
+}

+ 3 - 3
Source/BansheeUtility/Include/BsMatrix3.h

@@ -24,11 +24,11 @@ namespace BansheeEngine
     public:
 		Matrix3() {}
 
-		Matrix3(ZERO zero)
+		Matrix3(BS_ZERO zero)
 			:Matrix3(Matrix3::ZERO)
 		{ }
 
-		Matrix3(IDENTITY identity)
+		Matrix3(BS_IDENTITY identity)
 			:Matrix3(Matrix3::IDENTITY)
 		{ }
 
@@ -304,4 +304,4 @@ namespace BansheeEngine
 	/** @cond SPECIALIZATIONS */
 	BS_ALLOW_MEMCPY_SERIALIZATION(Matrix3);
 	/** @endcond */
-}
+}

+ 3 - 3
Source/BansheeUtility/Include/BsMatrix4.h

@@ -29,11 +29,11 @@ namespace BansheeEngine
         Matrix4()
         { }
 
-		Matrix4(ZERO zero)
+		Matrix4(BS_ZERO zero)
 			:Matrix4(Matrix3::ZERO)
 		{ }
 
-		Matrix4(IDENTITY identity)
+		Matrix4(BS_IDENTITY identity)
 			:Matrix4(Matrix3::IDENTITY)
 		{ }
 
@@ -476,4 +476,4 @@ namespace BansheeEngine
 	/** @cond SPECIALIZATIONS */
 	BS_ALLOW_MEMCPY_SERIALIZATION(Matrix4);
 	/** @endcond */
-}
+}

+ 3 - 3
Source/BansheeUtility/Include/BsQuaternion.h

@@ -25,11 +25,11 @@ namespace BansheeEngine
 		Quaternion()
 		{ }
 
-		Quaternion(ZERO zero)
+		Quaternion(BS_ZERO zero)
 			:x(0.0f), y(0.0f), z(0.0f), w(0.0f)
 		{ }
 
-		Quaternion(IDENTITY identity)
+		Quaternion(BS_IDENTITY identity)
 			:x(0.0f), y(0.0f), z(0.0f), w(1.0f)
 		{ }
 
@@ -376,4 +376,4 @@ namespace BansheeEngine
 	/** @cond SPECIALIZATIONS */
 	BS_ALLOW_MEMCPY_SERIALIZATION(Quaternion);
 	/** @endcond */
-}
+}

+ 2 - 2
Source/BansheeUtility/Include/BsVector2.h

@@ -21,7 +21,7 @@ namespace BansheeEngine
 		Vector2()
 		{ }
 
-        Vector2(ZERO zero)
+        Vector2(BS_ZERO zero)
 			:x(0.0f), y(0.0f)
         { }
 
@@ -374,4 +374,4 @@ namespace BansheeEngine
 	/** @cond SPECIALIZATIONS */
 	BS_ALLOW_MEMCPY_SERIALIZATION(Vector2);
 	/** @endcond */
-}
+}

+ 1 - 1
Source/BansheeUtility/Include/BsVector3.h

@@ -23,7 +23,7 @@ namespace BansheeEngine
 		Vector3()
 		{ }
 
-        Vector3(ZERO zero)
+        Vector3(BS_ZERO zero)
 			:x(0.0f), y(0.0f), z(0.0f)
         { }
 

+ 1 - 1
Source/BansheeUtility/Include/BsVector4.h

@@ -21,7 +21,7 @@ namespace BansheeEngine
 		Vector4()
 		{ }
 
-        Vector4(ZERO zero)
+        Vector4(BS_ZERO zero)
 			:x(0.0f), y(0.0f), z(0.0f), w(0.0f)
         { }