From ce6e1556a999f63bb10c1e060fc2eed1f3528774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 30 Jan 2022 18:45:01 +0100 Subject: [PATCH] Trade: suppress stupid deprecation warnings on MSVC. Like, I can't even, why does it warn for function *definitions* for a deprecated class which don't even use the deprecated class name anywhere except the fully qualified name? Why does it warn here but not for, say, ObjectData2D? --- src/Magnum/Trade/MeshData2D.cpp | 16 ++++++++++++++++ src/Magnum/Trade/MeshData3D.cpp | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/Magnum/Trade/MeshData2D.cpp b/src/Magnum/Trade/MeshData2D.cpp index 459cfcf3b..889f234bc 100644 --- a/src/Magnum/Trade/MeshData2D.cpp +++ b/src/Magnum/Trade/MeshData2D.cpp @@ -84,44 +84,60 @@ MeshData2D& MeshData2D::operator=(MeshData2D&&) = default; CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData2D::indices() { CORRADE_ASSERT(isIndexed(), "Trade::MeshData2D::indices(): the mesh is not indexed", _indices); return _indices; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData2D::indices() const { CORRADE_ASSERT(isIndexed(), "Trade::MeshData2D::indices(): the mesh is not indexed", _indices); return _indices; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData2D::positions(const UnsignedInt id) { CORRADE_ASSERT(id < positionArrayCount(), "Trade::MeshData2D::positions(): index out of range", _positions[id]); return _positions[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData2D::positions(const UnsignedInt id) const { CORRADE_ASSERT(id < positionArrayCount(), "Trade::MeshData2D::positions(): index out of range", _positions[id]); return _positions[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData2D::textureCoords2D(const UnsignedInt id) { CORRADE_ASSERT(id < textureCoords2DArrayCount(), "Trade::MeshData2D::textureCoords2D(): index out of range", _textureCoords2D[id]); return _textureCoords2D[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData2D::textureCoords2D(const UnsignedInt id) const { CORRADE_ASSERT(id < textureCoords2DArrayCount(), "Trade::MeshData2D::textureCoords2D(): index out of range", _textureCoords2D[id]); return _textureCoords2D[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData2D::colors(const UnsignedInt id) { CORRADE_ASSERT(id < colorArrayCount(), "Trade::MeshData3D::colors(): index out of range", _colors[id]); return _colors[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData2D::colors(const UnsignedInt id) const { CORRADE_ASSERT(id < colorArrayCount(), "Trade::MeshData3D::colors(): index out of range", _colors[id]); return _colors[id]; } +CORRADE_IGNORE_DEPRECATED_POP }} diff --git a/src/Magnum/Trade/MeshData3D.cpp b/src/Magnum/Trade/MeshData3D.cpp index 3082d7040..d0c4c5359 100644 --- a/src/Magnum/Trade/MeshData3D.cpp +++ b/src/Magnum/Trade/MeshData3D.cpp @@ -90,54 +90,74 @@ MeshData3D& MeshData3D::operator=(MeshData3D&&) = default; CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData3D::indices() { CORRADE_ASSERT(isIndexed(), "Trade::MeshData3D::indices(): the mesh is not indexed", _indices); return _indices; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData3D::indices() const { CORRADE_ASSERT(isIndexed(), "Trade::MeshData3D::indices(): the mesh is not indexed", _indices); return _indices; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData3D::positions(const UnsignedInt id) { CORRADE_ASSERT(id < positionArrayCount(), "Trade::MeshData3D::positions(): index out of range", _positions[id]); return _positions[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData3D::positions(const UnsignedInt id) const { CORRADE_ASSERT(id < positionArrayCount(), "Trade::MeshData3D::positions(): index out of range", _positions[id]); return _positions[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData3D::normals(const UnsignedInt id) { CORRADE_ASSERT(id < normalArrayCount(), "Trade::MeshData3D::normals(): index out of range", _normals[id]); return _normals[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData3D::normals(const UnsignedInt id) const { CORRADE_ASSERT(id < normalArrayCount(), "Trade::MeshData3D::normals(): index out of range", _normals[id]); return _normals[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData3D::textureCoords2D(const UnsignedInt id) { CORRADE_ASSERT(id < textureCoords2DArrayCount(), "Trade::MeshData3D::textureCoords2D(): index out of range", _textureCoords2D[id]); return _textureCoords2D[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData3D::textureCoords2D(const UnsignedInt id) const { CORRADE_ASSERT(id < textureCoords2DArrayCount(), "Trade::MeshData3D::textureCoords2D(): index out of range", _textureCoords2D[id]); return _textureCoords2D[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ std::vector& MeshData3D::colors(const UnsignedInt id) { CORRADE_ASSERT(id < colorArrayCount(), "Trade::MeshData3D::colors(): index out of range", _colors[id]); return _colors[id]; } +CORRADE_IGNORE_DEPRECATED_POP +CORRADE_IGNORE_DEPRECATED_PUSH /* MSVC warns here, for some reason */ const std::vector& MeshData3D::colors(const UnsignedInt id) const { CORRADE_ASSERT(id < colorArrayCount(), "Trade::MeshData3D::colors(): index out of range", _colors[id]); return _colors[id]; } +CORRADE_IGNORE_DEPRECATED_POP }}