summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/libsfml/files/libsfml-2.5.1-clang-16-auto_ptr.patch')
-rw-r--r--media-libs/libsfml/files/libsfml-2.5.1-clang-16-auto_ptr.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/media-libs/libsfml/files/libsfml-2.5.1-clang-16-auto_ptr.patch b/media-libs/libsfml/files/libsfml-2.5.1-clang-16-auto_ptr.patch
new file mode 100644
index 000000000000..ba4f90e4c465
--- /dev/null
+++ b/media-libs/libsfml/files/libsfml-2.5.1-clang-16-auto_ptr.patch
@@ -0,0 +1,50 @@
+https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49
+Bug: https://bugs.gentoo.org/910519
+From: Tobias Widlund <widlundtobias@gmail.com>
+Date: Fri, 18 Jan 2019 14:12:14 +0100
+Subject: [PATCH] Remove usages of std::auto_ptr to get rid of warnings when
+ building with gcc 8.2+
+
+--- a/src/SFML/Audio/AudioDevice.cpp
++++ b/src/SFML/Audio/AudioDevice.cpp
+@@ -29,7 +29,7 @@
+ #include <SFML/Audio/ALCheck.hpp>
+ #include <SFML/Audio/Listener.hpp>
+ #include <SFML/System/Err.hpp>
+-#include <memory>
++#include <vector>
+
+
+ namespace
+@@ -107,9 +107,13 @@ bool AudioDevice::isExtensionSupported(const std::string& extension)
+ // This device will not be used in this function and merely
+ // makes sure there is a valid OpenAL device for extension
+ // queries if none has been created yet.
+- std::auto_ptr<AudioDevice> device;
++ //
++ // Using an std::vector for this since auto_ptr is deprecated
++ // and we have no better STL facility for dynamically allocating
++ // a temporary instance with strong exception guarantee.
++ std::vector<AudioDevice> device;
+ if (!audioDevice)
+- device.reset(new AudioDevice);
++ device.resize(1);
+
+ if ((extension.length() > 2) && (extension.substr(0, 3) == "ALC"))
+ return alcIsExtensionPresent(audioDevice, extension.c_str()) != AL_FALSE;
+@@ -125,9 +129,13 @@ int AudioDevice::getFormatFromChannelCount(unsigned int channelCount)
+ // This device will not be used in this function and merely
+ // makes sure there is a valid OpenAL device for format
+ // queries if none has been created yet.
+- std::auto_ptr<AudioDevice> device;
++ //
++ // Using an std::vector for this since auto_ptr is deprecated
++ // and we have no better STL facility for dynamically allocating
++ // a temporary instance with strong exception guarantee.
++ std::vector<AudioDevice> device;
+ if (!audioDevice)
+- device.reset(new AudioDevice);
++ device.resize(1);
+
+ // Find the good format according to the number of channels
+ int format = 0;