Browse Source

SceneGraph: disable warnings about use of deprecated APIs on MSVC.

Both GCC and Clang don't warn if deprecated function is used from inside
another deprecated function (as one would expect). However, MSVC is
doing that and producing a lot of noise. Even worse, when trying to
compile the code under new WindowsStore/WindowsPhone SDKs, the project
files now by default treat these warnings as errors, making the code
uncompilable (unless deprecated API is turned off by disabling
BUILD_DEPRECATED in CMake).
pull/116/head
Vladimír Vondruš 11 years ago
parent
commit
4faed586fb
  1. 3
      src/Magnum/SceneGraph/AbstractTranslationRotation2D.h
  2. 3
      src/Magnum/SceneGraph/AbstractTranslationRotation3D.h
  3. 6
      src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h
  4. 18
      src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h
  5. 9
      src/Magnum/SceneGraph/DualQuaternionTransformation.h

3
src/Magnum/SceneGraph/AbstractTranslationRotation2D.h

@ -95,6 +95,9 @@ template<class T> class AbstractBasicTranslationRotation2D: public AbstractBasic
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation2D<T>& translate(const Math::Vector2<T>& vector, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslation2D<T>::translate(vector, type);
return *this;
}

3
src/Magnum/SceneGraph/AbstractTranslationRotation3D.h

@ -213,6 +213,9 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractBasic
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation3D<T>& translate(const Math::Vector3<T>& vector, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslation3D<T>::translate(vector, type);
return *this;
}

6
src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h

@ -95,6 +95,9 @@ template<class T> class AbstractBasicTranslationRotationScaling2D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotationScaling2D<T>& translate(const Math::Vector2<T>& vector, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation2D<T>::translate(vector, type);
return *this;
}
@ -109,6 +112,9 @@ template<class T> class AbstractBasicTranslationRotationScaling2D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotate() or rotateLocal() instead") AbstractBasicTranslationRotationScaling2D<T>& rotate(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation2D<T>::rotate(angle, type);
return *this;
}

18
src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h

@ -75,6 +75,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
* @deprecated Use @ref scale() or @ref scaleLocal() instead.
*/
CORRADE_DEPRECATED("use scale() or scaleLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& scale(const Math::Vector3<T>& vector, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
return type == TransformationType::Global ? scale(vector) : scaleLocal(vector);
}
#endif
@ -95,6 +98,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& translate(const Math::Vector3<T>& vector, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation3D<T>::translate(vector, type);
return *this;
}
@ -109,6 +115,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotate() or rotateLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation3D<T>::rotate(angle, normalizedAxis, type);
return *this;
}
@ -123,6 +132,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateX() or rotateXLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& rotateX(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation3D<T>::rotateX(angle, type);
return *this;
}
@ -137,6 +149,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateY() or rotateYLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& rotateY(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation3D<T>::rotateY(angle, type);
return *this;
}
@ -151,6 +166,9 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateZ() or rotateZLocal() instead") AbstractBasicTranslationRotationScaling3D<T>& rotateZ(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
AbstractBasicTranslationRotation3D<T>::rotateZ(angle, type);
return *this;
}

9
src/Magnum/SceneGraph/DualQuaternionTransformation.h

@ -196,6 +196,9 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateX() or rotateXLocal() instead") Object<BasicDualQuaternionTransformation<T>>& rotateX(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
return rotate(angle, Math::Vector3<T>::xAxis(), type);
}
#endif
@ -207,6 +210,9 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateY() or rotateYLocal() instead") Object<BasicDualQuaternionTransformation<T>>& rotateY(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
return rotate(angle, Math::Vector3<T>::yAxis(), type);
}
#endif
@ -218,6 +224,9 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use rotateZ() or rotateZLocal() instead") Object<BasicDualQuaternionTransformation<T>>& rotateZ(Math::Rad<T> angle, TransformationType type) {
#ifdef _MSC_VER
#pragma warning(suppress: 4996)
#endif
return rotate(angle, Math::Vector3<T>::zAxis(), type);
}
#endif

Loading…
Cancel
Save