From b14d0b47e6f18fe06645c7d9c9e4910511846025 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 12 May 2023 22:25:06 -0600 Subject: [PATCH] Fix broken `sf::swap` overloads --- include/SFML/Graphics/Texture.hpp | 2 +- include/SFML/Graphics/VertexBuffer.hpp | 2 +- test/Graphics/Texture.test.cpp | 2 +- test/Graphics/VertexBuffer.test.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/SFML/Graphics/Texture.hpp b/include/SFML/Graphics/Texture.hpp index 74450b8b9..e47270b04 100644 --- a/include/SFML/Graphics/Texture.hpp +++ b/include/SFML/Graphics/Texture.hpp @@ -637,7 +637,7 @@ private: /// \param right Second instance to swap /// //////////////////////////////////////////////////////////// -void swap(Texture& left, Texture& right) noexcept; +SFML_GRAPHICS_API void swap(Texture& left, Texture& right) noexcept; } // namespace sf diff --git a/include/SFML/Graphics/VertexBuffer.hpp b/include/SFML/Graphics/VertexBuffer.hpp index c9a060e88..af942863c 100644 --- a/include/SFML/Graphics/VertexBuffer.hpp +++ b/include/SFML/Graphics/VertexBuffer.hpp @@ -346,7 +346,7 @@ private: /// \param right Second instance to swap /// //////////////////////////////////////////////////////////// -void swap(VertexBuffer& left, VertexBuffer& right) noexcept; +SFML_GRAPHICS_API void swap(VertexBuffer& left, VertexBuffer& right) noexcept; } // namespace sf diff --git a/test/Graphics/Texture.test.cpp b/test/Graphics/Texture.test.cpp index e1e116292..3b3152508 100644 --- a/test/Graphics/Texture.test.cpp +++ b/test/Graphics/Texture.test.cpp @@ -196,7 +196,7 @@ TEST_CASE("[Graphics] sf::Texture" * doctest::skip(skipDisplayTests)) texture2.setSmooth(true); texture2.setRepeated(false); - std::swap(texture1, texture2); + sf::swap(texture1, texture2); CHECK_FALSE(texture1.isSrgb()); CHECK(texture1.isSmooth()); CHECK_FALSE(texture1.isRepeated()); diff --git a/test/Graphics/VertexBuffer.test.cpp b/test/Graphics/VertexBuffer.test.cpp index 4b2b9969c..41efbb276 100644 --- a/test/Graphics/VertexBuffer.test.cpp +++ b/test/Graphics/VertexBuffer.test.cpp @@ -149,7 +149,7 @@ TEST_CASE("[Graphics] sf::VertexBuffer" * doctest::skip(true)) sf::VertexBuffer vertexBuffer2(sf::PrimitiveType::TriangleStrip, sf::VertexBuffer::Stream); CHECK(vertexBuffer2.create(60)); - std::swap(vertexBuffer1, vertexBuffer2); + sf::swap(vertexBuffer1, vertexBuffer2); CHECK(vertexBuffer1.getVertexCount() == 60); CHECK(vertexBuffer1.getNativeHandle() != 0);