Browse Source

Fix loud linker error on mingw32.

Mingw for some reasons instantiates depending template before dependent
one, causing the dependent one to be instantiated twice.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
56bb116305
  1. 12
      src/Math/instantiation.cpp

12
src/Math/instantiation.cpp

@ -52,21 +52,33 @@ template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum:
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Double>>;
#endif
/* For some reason mingw's GCC instantiates ConfigurationValue<Magnum::Math::Geometry::Rectangle<...>>
(which depends on ConfigurationValue<Magnum::Math::Vector<4, ...>) before
these and then loudly complains about multiple definitions. WTF. */
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Float>>;
#ifndef _WIN32
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Float>>;
#endif
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Int>>;
#ifndef _WIN32
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Int>>;
#endif
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::UnsignedInt>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::UnsignedInt>>;
#ifndef _WIN32
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::UnsignedInt>>;
#endif
#ifndef MAGNUM_TARGET_GLES
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Double>>;
#ifndef _WIN32
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Double>>;
#endif
#endif
#endif
}}

Loading…
Cancel
Save