Browse Source

MSVC 2015 compatibility: in-class init of constexpr is not implemented.

Breaks backward compatibility in one place, but I think that feature
wasn't widely used anyway so I'm not fixing that.
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
0cd3b20ba3
  1. 4
      src/Magnum/Implementation/FramebufferState.cpp
  2. 6
      src/Magnum/Implementation/FramebufferState.h
  3. 4
      src/Magnum/Math/Matrix.h

4
src/Magnum/Implementation/FramebufferState.cpp

@ -33,7 +33,11 @@
namespace Magnum { namespace Implementation {
#ifndef CORRADE_MSVC2015_COMPATIBILITY
constexpr const Range2Di FramebufferState::DisengagedViewport;
#else
const Range2Di FramebufferState::DisengagedViewport{{}, {-1, -1}};
#endif
FramebufferState::FramebufferState(Context& context, std::vector<std::string>& extensions): readBinding{0}, drawBinding{0}, renderbufferBinding{0}, maxDrawBuffers{0}, maxColorAttachments{0}, maxRenderbufferSize{0},
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))

6
src/Magnum/Implementation/FramebufferState.h

@ -33,7 +33,13 @@
namespace Magnum { namespace Implementation {
struct FramebufferState {
#ifndef CORRADE_MSVC2015_COMPATIBILITY
/* MSVC complains that in-class initialization is not yet implemented */
constexpr static const Range2Di DisengagedViewport{{}, {-1, -1}};
#else
static const Range2Di DisengagedViewport;
#endif
explicit FramebufferState(Context& context, std::vector<std::string>& extensions);

4
src/Magnum/Math/Matrix.h

@ -54,6 +54,9 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
};
#ifdef MAGNUM_BUILD_DEPRECATED
/* Sorry, MSVC complains that in-class initialization is not yet
implemented and it is not worth fixing */
#ifndef CORRADE_MSVC2015_COMPATIBILITY
/**
* @brief Pass to constructor to create zero-filled matrix
* @deprecated Use @ref ZeroInitT and @ref ZeroInit instead.
@ -76,6 +79,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
CORRADE_DEPRECATED("use Math::IdentityInit instead") constexpr static IdentityInitT Identity{};
#endif
#endif
#endif
/**
* @brief Default constructor

Loading…
Cancel
Save