Browse Source

Merge branch 'hotfix/visualstudio-missing-roundf'

Fix for issue #157 created when PR #156 was merged.
David Wimsey 11 years ago
parent
commit
91ad8177e1
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Source/Core/LayoutEngine.cpp

+ 5 - 0
Source/Core/LayoutEngine.cpp

@@ -282,7 +282,12 @@ Vector2f& LayoutEngine::Round(Vector2f& value)
 // Rounds a floating-point value to an integral value.
 // Rounds a floating-point value to an integral value.
 float LayoutEngine::Round(float value)
 float LayoutEngine::Round(float value)
 {
 {
+#if defined(_MSC_VER) && _MSC_VER < 1800
+	// Before Visual Studio 2013, roundf did not exist
+	return value >= 0.0f ? floorf(value + 0.5f) : ceilf(value - 0.5f);
+#else
 	return roundf(value);
 	return roundf(value);
+#endif
 }
 }
 
 
 void* LayoutEngine::AllocateLayoutChunk(size_t size)
 void* LayoutEngine::AllocateLayoutChunk(size_t size)