| Backport upstream patch |
| https://github.com/glmark2/glmark2/commit/3137e5c184581c9a69c687ecf46ba08f02c4117b |
| to remove uses of deprecated std::auto_ptr. |
| |
| commit 3137e5c184581c9a69c687ecf46ba08f02c4117b |
| Author: Alexandre Courbot <acourbot@nvidia.com> |
| Date: 2016-09-08 |
| |
| Do not use deprecated std::auto_ptr |
| |
| auto_ptr has been deprecated in recent C++ revisions. As glmark2 is |
| compiled with -Werror by default, this results in compilation failures |
| with recent g++ versions, e.g: |
| |
| ../src/model.cpp:684:16: error: ‘template<class> class std::auto_ptr’ is deprecated [-Werror=deprecated-declarations] |
| |
| Replace the use of auto_ptr with unique_ptr throughout the code to fix |
| this. |
| |
| --- a/src/image-reader.cpp |
| +++ b/src/image-reader.cpp |
| @@ -120,7 +120,7 @@ PNGReader::init(const std::string& filename) |
| |
| Log::debug("Reading PNG file %s\n", filename.c_str()); |
| |
| - const std::auto_ptr<std::istream> is_ptr(Util::get_resource(filename)); |
| + const std::unique_ptr<std::istream> is_ptr(Util::get_resource(filename)); |
| if (!(*is_ptr)) { |
| Log::error("Cannot open file %s!\n", filename.c_str()); |
| return false; |
| --- a/src/libmatrix/shader-source.cc |
| +++ b/src/libmatrix/shader-source.cc |
| @@ -34,7 +34,7 @@ ShaderSource::default_precision_(ShaderSource::ShaderTypeUnknown + 1); |
| bool |
| ShaderSource::load_file(const std::string& filename, std::string& str) |
| { |
| - std::auto_ptr<std::istream> is_ptr(Util::get_resource(filename)); |
| + std::unique_ptr<std::istream> is_ptr(Util::get_resource(filename)); |
| std::istream& inputFile(*is_ptr); |
| |
| if (!inputFile) |
| --- a/src/model.cpp |
| +++ b/src/model.cpp |
| @@ -361,7 +361,7 @@ Model::load_3ds(const std::string &filename) |
| |
| Log::debug("Loading model from 3ds file '%s'\n", filename.c_str()); |
| |
| - const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| + const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| std::istream& input_file(*input_file_ptr); |
| |
| if (!input_file) { |
| @@ -681,7 +681,7 @@ Model::load_obj(const std::string &filename) |
| { |
| Log::debug("Loading model from obj file '%s'\n", filename.c_str()); |
| |
| - const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| + const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| std::istream& inputFile(*input_file_ptr); |
| if (!inputFile) |
| { |
| --- a/src/scene-jellyfish.cpp |
| +++ b/src/scene-jellyfish.cpp |
| @@ -272,7 +272,7 @@ JellyfishPrivate::load_obj(const std::string &filename) |
| { |
| Log::debug("Loading model from file '%s'\n", filename.c_str()); |
| |
| - const std::auto_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| + const std::unique_ptr<std::istream> input_file_ptr(Util::get_resource(filename)); |
| std::istream& inputFile(*input_file_ptr); |
| if (!inputFile) |
| { |