Browse Source

Trying to fix compilation issues (why is std::string suddenly more than 32 bytes?)

Michael Ragazzon 6 years ago
parent
commit
27fe058191

+ 0 - 1
Include/Rocket/Core/Debug.h

@@ -103,6 +103,5 @@ template <> struct STATIC_ASSERTION_FAILURE<true>{};
 	
 	
 }
 }
 }
 }
-#define ROCKET_STATIC_ASSERT(cond, msg) Rocket::Core::STATIC_ASSERTION_FAILURE<cond> msg; (void)&msg;
 
 
 #endif
 #endif

+ 1 - 1
Include/Rocket/Core/Variant.h

@@ -138,7 +138,7 @@ private:
 	void Set(ScriptInterface* value);
 	void Set(ScriptInterface* value);
 	
 	
 #ifdef ROCKET_ARCH_64
 #ifdef ROCKET_ARCH_64
-		static const int LOCAL_DATA_SIZE = 32; // Required for Strings
+		static const int LOCAL_DATA_SIZE = 40; // Required for Strings
 #else
 #else
 		static const int LOCAL_DATA_SIZE = 24;
 		static const int LOCAL_DATA_SIZE = 24;
 #endif
 #endif

+ 1 - 1
Include/Rocket/Core/Vector3.inl

@@ -67,7 +67,7 @@ Type Vector3< Type >::SquaredMagnitude() const
 template < typename Type >
 template < typename Type >
 Vector3< Type > Vector3< Type >::Normalise() const
 Vector3< Type > Vector3< Type >::Normalise() const
 {
 {
-	ROCKET_STATIC_ASSERT(std::is_floating_point< Type >::value, Invalid_Operation);
+	static_assert(std::is_floating_point< Type >::value, "Invalid operation");
 	return *this;
 	return *this;
 }
 }
 
 

+ 1 - 1
Include/Rocket/Core/Vector4.inl

@@ -72,7 +72,7 @@ Type Vector4< Type >::SquaredMagnitude() const
 template < typename Type >
 template < typename Type >
 Vector4< Type > Vector4< Type >::Normalise() const
 Vector4< Type > Vector4< Type >::Normalise() const
 {
 {
-	ROCKET_STATIC_ASSERT(std::is_floating_point< Type >::value, Invalid_Operation);
+	static_assert(std::is_floating_point< Type >::value, "Invalid operation");
 	return *this;
 	return *this;
 }
 }
 
 

+ 2 - 2
Source/Core/Element.cpp

@@ -98,12 +98,12 @@ struct ElementMeta
 	ElementScroll scroll;
 	ElementScroll scroll;
 	Style::ComputedValues computed_values;
 	Style::ComputedValues computed_values;
 
 
-	void* ElementMeta::operator new(size_t size)
+	void* operator new(size_t size)
 	{
 	{
 		void* memory = element_meta_chunk_pool.AllocateObject();
 		void* memory = element_meta_chunk_pool.AllocateObject();
 		return memory;
 		return memory;
 	}
 	}
-	void ElementMeta::operator delete(void* chunk)
+	void operator delete(void* chunk)
 	{
 	{
 		element_meta_chunk_pool.DeallocateObject((ElementMetaChunk*)chunk);
 		element_meta_chunk_pool.DeallocateObject((ElementMetaChunk*)chunk);
 	}
 	}

+ 5 - 5
Source/Core/Variant.cpp

@@ -34,11 +34,11 @@ namespace Core {
 Variant::Variant() : type(NONE)
 Variant::Variant() : type(NONE)
 {
 {
 	// Make sure our object size assumptions fit inside the static buffer
 	// Make sure our object size assumptions fit inside the static buffer
-	ROCKET_STATIC_ASSERT(sizeof(Colourb) <= LOCAL_DATA_SIZE, LOCAL_DATA_TOO_SMALL_FOR_Colourb);
-	ROCKET_STATIC_ASSERT(sizeof(Colourf) <= LOCAL_DATA_SIZE, LOCAL_DATA_TOO_SMALL_FOR_Colourf);
-	ROCKET_STATIC_ASSERT(sizeof(String) <= LOCAL_DATA_SIZE, LOCAL_DATA_TOO_SMALL_FOR_String);
-	ROCKET_STATIC_ASSERT(sizeof(TransitionList) <= LOCAL_DATA_SIZE, LOCAL_DATA_TOO_SMALL_FOR_TRANSITION_LIST);
-	ROCKET_STATIC_ASSERT(sizeof(AnimationList) <= LOCAL_DATA_SIZE, LOCAL_DATA_TOO_SMALL_FOR_ANIMATION_LIST);
+	static_assert(sizeof(Colourb) <= LOCAL_DATA_SIZE, "Local data too small for Colourb");
+	static_assert(sizeof(Colourf) <= LOCAL_DATA_SIZE, "Local data too small for Colourf");
+	static_assert(sizeof(String) <= LOCAL_DATA_SIZE, "Local data too small for String");
+	static_assert(sizeof(TransitionList) <= LOCAL_DATA_SIZE, "Local data too small for TransitionList");
+	static_assert(sizeof(AnimationList) <= LOCAL_DATA_SIZE, "Local data too small for AnimationList");
 }
 }
 
 
 Variant::Variant( const Variant& copy ) : type(NONE)
 Variant::Variant( const Variant& copy ) : type(NONE)