I can't find a way to search the forum so my apologies if this is answered somewhere else.
I see several uses of std::auto_ptr
inside of libraw_datastream
. This has been deprecated in favor of using std::unique_ptr
and/or std::move()
and std::shared_ptr
(as appropriate) back in the c++0x specs (https://stackoverflow.com/questions/2404115/is-auto-ptr-deprecated). It's still hung around and worked in most compilers but now Microsoft has thrown down the gauntlet and the latest version of visual studio 2017 has REMOVED auto_ptr completely, hence libraw will not compile.
Has anyone dealt with this yet? I've tried looking through the code in the repo on various branches (master and 0.19-stable) and I still see auto_ptr
in use but I'm still getting used to your repo and may just be looking in the wrong place. I'm going to try and patch the code to use unique_ptr
and move()
but don't want to be reinventing the wheel. I'm also probably not the best person to make the decision of what to replace the auto_ptr
s with as I barely know this code base.
My other question is what is the current intended build system to use? I see the QMake .pro files in there and have been using those but they require a lot of tweeking on both system's I'm compiling for (Mac OS and Windows) so I'm wondering if they are not up to date and if I should be using something different to build.
Cheers!
Seth B.
We know that auto_ptr is
We know that auto_ptr is deprecated. We'll address this issue in next major change, not in 0.19
-- Alex Tutubalin @LibRaw LLC
Quick fix
If you are willing to build it yourself, the edits are trivial to make it use std::unique_ptr instead.. Just replace the two std::auto_ptr instances in the libraw_datastream.h with std::unique_ptr (along with the export)
Then go into the CPP file and make sure that
a) every construction of the filebuf that formerly looked like this:
std::auto_ptr<std::filebuf> buf(new std::filebuf());
Now looks like this:
auto buf = std::make_unique<std::filebuf>();
Also, wrap each assignment of what used to be an auto-ptr with std::move. So, for example, this line:
f = saved_f;
changes to this:
f = std::move(saved_f);
What is minimal compiler
What is minimal compiler/libstdc++/libc++ for that?
Will it compile on MacOS 10.6 using XCode 4.3 (for example)?
-- Alex Tutubalin @LibRaw LLC
Followup: the issue solved in
Followup: the issue solved in current public snapshot via #if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520) and/or LIBRAW_USE_AUTOPTR define
-- Alex Tutubalin @LibRaw LLC