Browse Source

MSVC 2013 compatibility: more {}-related workarounds.

These don't lead to internal compiler errors, but still generate cryptic
error messages.
Vladimír Vondruš 13 years ago
parent
commit
74fcce641a
  1. 6
      src/Math/Test/MatrixTest.cpp
  2. 3
      src/Math/Test/RangeTest.cpp
  3. 6
      src/Math/Test/RectangularMatrixTest.cpp
  4. 3
      src/Math/Test/VectorTest.cpp
  5. 7
      src/MeshTools/Test/TipsifyTest.cpp
  6. 3
      src/Text/Test/AbstractFontConverterTest.cpp

6
src/Math/Test/MatrixTest.cpp

@ -301,12 +301,14 @@ void MatrixTest::invertedOrthogonal() {
template<class T> class BasicVec2: public Math::Vector<2, T> {
public:
template<class ...U> BasicVec2(U&&... args): Math::Vector<2, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicVec2(U&&... args): Math::Vector<2, T>(std::forward<U>(args)...) {}
};
template<class T> class BasicMat2: public Math::Matrix<2, T> {
public:
template<class ...U> BasicMat2(U&&... args): Math::Matrix<2, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicMat2(U&&... args): Math::Matrix<2, T>(std::forward<U>(args)...) {}
MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(2, BasicMat2, BasicVec2)
};

3
src/Math/Test/RangeTest.cpp

@ -319,7 +319,8 @@ void RangeTest::scaled() {
template<class T> class BasicRect: public Math::Range<2, T> {
public:
template<class ...U> BasicRect(U&&... args): Math::Range<2, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicRect(U&&... args): Math::Range<2, T>(std::forward<U>(args)...) {}
MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(2, BasicRect, Vector2)
};

6
src/Math/Test/RectangularMatrixTest.cpp

@ -422,7 +422,8 @@ void RectangularMatrixTest::vector() {
template<std::size_t size, class T> class BasicMat: public Math::RectangularMatrix<size, size, T> {
public:
template<class ...U> BasicMat(U&&... args): Math::RectangularMatrix<size, size, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicMat(U&&... args): Math::RectangularMatrix<size, size, T>(std::forward<U>(args)...) {}
MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(size, size, BasicMat<size, T>)
};
@ -431,7 +432,8 @@ MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(BasicMat<size, T>)
template<class T> class BasicMat2x2: public BasicMat<2, T> {
public:
template<class ...U> BasicMat2x2(U&&... args): BasicMat<2, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicMat2x2(U&&... args): BasicMat<2, T>(std::forward<U>(args)...) {}
MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(2, 2, BasicMat2x2<T>)
};

3
src/Math/Test/VectorTest.cpp

@ -455,7 +455,8 @@ void VectorTest::angle() {
template<class T> class BasicVec2: public Math::Vector<2, T> {
public:
template<class ...U> BasicVec2(U&&... args): Math::Vector<2, T>{std::forward<U>(args)...} {}
/* MSVC 2013 can't cope with {} here */
template<class ...U> BasicVec2(U&&... args): Math::Vector<2, T>(std::forward<U>(args)...) {}
MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(2, BasicVec2)
};

7
src/MeshTools/Test/TipsifyTest.cpp

@ -56,7 +56,8 @@ class TipsifyTest: public TestSuite::Tester {
*/
TipsifyTest::TipsifyTest(): indices{
/* MSVC 2013 can't cope with only {} here */
TipsifyTest::TipsifyTest(): indices({
4, 1, 0,
10, 9, 13,
6, 3, 2,
@ -79,8 +80,8 @@ TipsifyTest::TipsifyTest(): indices{
14, 11, 10,
16, 17, 18
}, vertexCount(19) {
addTests({&TipsifyTest::buildAdjacency,
}), vertexCount(19) {
addTests<TipsifyTest>({&TipsifyTest::buildAdjacency,
&TipsifyTest::tipsify});
}

3
src/Text/Test/AbstractFontConverterTest.cpp

@ -171,7 +171,8 @@ void AbstractFontConverterTest::exportFontToFile() {
/* doExportToFile() should call doExportToData() */
DataExporter exporter;
bool exported = exporter.exportFontToFile(*static_cast<AbstractFont*>(nullptr), *static_cast<GlyphCache*>(nullptr), Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"), {});
/* MSVC 2013 can't handle {} here */
bool exported = exporter.exportFontToFile(*static_cast<AbstractFont*>(nullptr), *static_cast<GlyphCache*>(nullptr), Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"), std::string());
CORRADE_VERIFY(exported);
CORRADE_COMPARE_AS(Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"),
"\xf0", TestSuite::Compare::FileToString);

Loading…
Cancel
Save