diff --git a/CMakeLists.txt b/CMakeLists.txt index 4879d514..4b90f26c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,11 @@ project(exiv2 # use TWEAK to categorize the build # 0.27.3.29 = RC2 Not for release LANGUAGES CXX C ) +set(CMAKE_CXX_STANDARD 14) + include(cmake/mainSetup.cmake REQUIRED) + # options and their default values option( BUILD_SHARED_LIBS "Build exiv2lib as a shared library" ON ) option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON ) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index ec3a43f5..ed48a96d 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -13,7 +13,7 @@ if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(NO_OUTPUT_DIRS KEEP_RPATHS TARGETS) endif() -find_package(Threads REQUIRED) +# find_package(Threads REQUIRED) if( EXIV2_ENABLE_PNG ) find_package( ZLIB REQUIRED ) diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp index 1cd98791..a06fa78e 100644 --- a/include/exiv2/basicio.hpp +++ b/include/exiv2/basicio.hpp @@ -30,7 +30,7 @@ #include "types.hpp" // + standard includes -#include // for std::auto_ptr +#include // for Auto_Ptr // The way to handle data from stdin or data uri path. If EXV_XPATH_MEMIO = 1, // it uses MemIo. Otherwises, it uses FileIo. @@ -55,7 +55,7 @@ namespace Exiv2 { class EXIV2API BasicIo { public: //! BasicIo auto_ptr type - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! Seek starting positions enum Position { beg, cur, end }; @@ -521,7 +521,7 @@ namespace Exiv2 { // Pimpl idiom class Impl; - std::auto_ptr p_; + Auto_Ptr p_; }; // class FileIo @@ -721,7 +721,7 @@ namespace Exiv2 { // Pimpl idiom class Impl; - std::auto_ptr p_; + Auto_Ptr p_; }; // class MemIo diff --git a/include/exiv2/datasets.hpp b/include/exiv2/datasets.hpp index 2ac98c3a..9ef98471 100644 --- a/include/exiv2/datasets.hpp +++ b/include/exiv2/datasets.hpp @@ -275,7 +275,7 @@ namespace Exiv2 { class EXIV2API IptcKey : public Key { public: //! Shortcut for an %IptcKey auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp index 7b0ac555..b76cb320 100644 --- a/include/exiv2/image.hpp +++ b/include/exiv2/image.hpp @@ -81,7 +81,7 @@ namespace Exiv2 { class EXIV2API Image { public: //! Image auto_ptr type - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ diff --git a/include/exiv2/metadatum.hpp b/include/exiv2/metadatum.hpp index 41640e28..8cd96ad5 100644 --- a/include/exiv2/metadatum.hpp +++ b/include/exiv2/metadatum.hpp @@ -55,7 +55,7 @@ namespace Exiv2 { class EXIV2API Key { public: //! Shortcut for a %Key auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ diff --git a/include/exiv2/properties.hpp b/include/exiv2/properties.hpp index 09db134d..923cfd5c 100644 --- a/include/exiv2/properties.hpp +++ b/include/exiv2/properties.hpp @@ -242,7 +242,7 @@ namespace Exiv2 { { public: //! Shortcut for an %XmpKey auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -305,7 +305,7 @@ namespace Exiv2 { private: // Pimpl idiom struct Impl; - std::auto_ptr p_; + Auto_Ptr p_; }; // class XmpKey diff --git a/include/exiv2/tags.hpp b/include/exiv2/tags.hpp index 6482c39b..fc4dbff7 100644 --- a/include/exiv2/tags.hpp +++ b/include/exiv2/tags.hpp @@ -148,7 +148,7 @@ namespace Exiv2 { class EXIV2API ExifKey : public Key { public: //! Shortcut for an %ExifKey auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -222,7 +222,7 @@ namespace Exiv2 { private: // Pimpl idiom struct Impl; - std::auto_ptr p_; + Auto_Ptr p_; }; // class ExifKey diff --git a/include/exiv2/types.hpp b/include/exiv2/types.hpp index 33ee3720..d910ecb8 100644 --- a/include/exiv2/types.hpp +++ b/include/exiv2/types.hpp @@ -42,6 +42,125 @@ #include #include +template +class Auto_Ptr; + +template +struct Auto_Ptr_ref +{ // proxy reference for auto_ptr copying + explicit Auto_Ptr_ref(_Ty * _Right) + : _Ref(_Right) + { // construct from generic pointer to auto_ptr ptr + } + + _Ty * _Ref; // generic pointer to auto_ptr ptr +}; + +template +class Auto_Ptr +{ // wrap an object pointer to ensure destruction +public: + typedef _Ty element_type; + + explicit Auto_Ptr(_Ty * _Ptr = nullptr) noexcept + : _Myptr(_Ptr) + { // construct from object pointer + } + + Auto_Ptr(Auto_Ptr& _Right) noexcept + : _Myptr(_Right.release()) + { // construct by assuming pointer from _Right auto_ptr + } + + Auto_Ptr(Auto_Ptr_ref<_Ty> _Right) noexcept + { // construct by assuming pointer from _Right auto_ptr_ref + _Ty * _Ptr = _Right._Ref; + _Right._Ref = nullptr; // release old + _Myptr = _Ptr; // reset this + } + + template + operator Auto_Ptr<_Other>() noexcept + { // convert to compatible auto_ptr + return (Auto_Ptr<_Other>(*this)); + } + + template + operator Auto_Ptr_ref<_Other>() noexcept + { // convert to compatible auto_ptr_ref + _Other * _Cvtptr = _Myptr; // test implicit conversion + Auto_Ptr_ref<_Other> _Ans(_Cvtptr); + _Myptr = nullptr; // pass ownership to auto_ptr_ref + return (_Ans); + } + + template + Auto_Ptr& operator=(Auto_Ptr<_Other>& _Right) noexcept + { // assign compatible _Right (assume pointer) + reset(_Right.release()); + return (*this); + } + + template + Auto_Ptr(Auto_Ptr<_Other>& _Right) noexcept + : _Myptr(_Right.release()) + { // construct by assuming pointer from _Right + } + + Auto_Ptr& operator=(Auto_Ptr& _Right) noexcept + { // assign compatible _Right (assume pointer) + reset(_Right.release()); + return (*this); + } + + Auto_Ptr& operator=(Auto_Ptr_ref<_Ty> _Right) noexcept + { // assign compatible _Right._Ref (assume pointer) + _Ty * _Ptr = _Right._Ref; + _Right._Ref = 0; // release old + reset(_Ptr); // set new + return (*this); + } + + ~Auto_Ptr() noexcept + { // destroy the object + delete _Myptr; + } + + _Ty& operator*() const noexcept + { // return designated value + return (*get()); + } + + _Ty * operator->() const noexcept + { // return pointer to class object + return (get()); + } + + _Ty * get() const noexcept + { // return wrapped pointer + return (_Myptr); + } + + _Ty * release() noexcept + { // return wrapped pointer and give up ownership + _Ty * _Tmp = _Myptr; + _Myptr = nullptr; + return (_Tmp); + } + + void reset(_Ty * _Ptr = nullptr) + { // destroy designated object and store new pointer + if (_Ptr != _Myptr) + delete _Myptr; + _Myptr = _Ptr; + } + +private: + _Ty * _Myptr; // the wrapped object pointer +}; + + + #ifdef _MSC_VER // Visual Studio 2010 and later has stdint.h # if _MSC_VER >= _MSC_VER_2010 @@ -213,7 +332,7 @@ namespace Exiv2 { DataBuf(const byte* pData, long size); /*! @brief Copy constructor. Transfers the buffer to the newly created - object similar to std::auto_ptr, i.e., the original object is + object similar to Auto_Ptr, i.e., the original object is modified. */ DataBuf(DataBuf& rhs); @@ -225,7 +344,7 @@ namespace Exiv2 { //@{ /*! @brief Assignment operator. Transfers the buffer and releases the - buffer at the original object similar to std::auto_ptr, i.e., + buffer at the original object similar to Auto_Ptr, i.e., the original object is modified. */ DataBuf& operator=(DataBuf& rhs); @@ -255,7 +374,7 @@ namespace Exiv2 { @name Conversions Special conversions with auxiliary type to enable copies - and assignments, similar to those used for std::auto_ptr. + and assignments, similar to those used for Auto_Ptr. See http://www.josuttis.com/libbook/auto_ptr.html for a discussion. */ //@{ diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 7ca57f36..f360aa4d 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -42,6 +42,8 @@ #include #include + + // ***************************************************************************** // namespace extensions namespace Exiv2 { @@ -60,7 +62,8 @@ namespace Exiv2 { class EXIV2API Value { public: //! Shortcut for a %Value auto pointer. - typedef std::auto_ptr AutoPtr; + + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -262,7 +265,7 @@ namespace Exiv2 { class EXIV2API DataValue : public Value { public: //! Shortcut for a %DataValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; explicit DataValue(TypeId typeId =undefined); @@ -344,7 +347,7 @@ namespace Exiv2 { class EXIV2API StringValueBase : public Value { public: //! Shortcut for a %StringValueBase auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -426,7 +429,7 @@ namespace Exiv2 { class EXIV2API StringValue : public StringValueBase { public: //! Shortcut for a %StringValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -458,7 +461,7 @@ namespace Exiv2 { class EXIV2API AsciiValue : public StringValueBase { public: //! Shortcut for a %AsciiValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -546,7 +549,7 @@ namespace Exiv2 { }; // class CharsetInfo //! Shortcut for a %CommentValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -633,7 +636,7 @@ namespace Exiv2 { class EXIV2API XmpValue : public Value { public: //! Shortcut for a %XmpValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! XMP array types. enum XmpArrayType { xaNone, xaAlt, xaBag, xaSeq }; @@ -724,7 +727,7 @@ namespace Exiv2 { class EXIV2API XmpTextValue : public XmpValue { public: //! Shortcut for a %XmpTextValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -806,7 +809,7 @@ namespace Exiv2 { class EXIV2API XmpArrayValue : public XmpValue { public: //! Shortcut for a %XmpArrayValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -899,7 +902,7 @@ namespace Exiv2 { class EXIV2API LangAltValue : public XmpValue { public: //! Shortcut for a %LangAltValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -987,7 +990,7 @@ namespace Exiv2 { class EXIV2API DateValue : public Value { public: //! Shortcut for a %DateValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -1088,7 +1091,7 @@ namespace Exiv2 { class EXIV2API TimeValue : public Value { public: //! Shortcut for a %TimeValue auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -1244,7 +1247,7 @@ namespace Exiv2 { class ValueType : public Value { public: //! Shortcut for a %ValueType\ auto pointer. - typedef std::auto_ptr > AutoPtr; + typedef Auto_Ptr > AutoPtr; //! @name Creators //@{ diff --git a/include/exiv2/xmp_exiv2.hpp b/include/exiv2/xmp_exiv2.hpp index 88a05c37..75b4468c 100644 --- a/include/exiv2/xmp_exiv2.hpp +++ b/include/exiv2/xmp_exiv2.hpp @@ -153,7 +153,7 @@ namespace Exiv2 { private: // Pimpl idiom struct Impl; - std::auto_ptr p_; + Auto_Ptr p_; }; // class Xmpdatum diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c3da2dc7..e023851b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -201,7 +201,7 @@ if (NOT MSVC) target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 ) endif() - target_link_libraries( exiv2lib PRIVATE Threads::Threads) + # target_link_libraries( exiv2lib PRIVATE Threads::Threads) else() target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 ) endif() diff --git a/src/actions.cpp b/src/actions.cpp index a941d677..678a8109 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1989,19 +1989,19 @@ namespace { static CRITICAL_SECTION cs; #else /* Unix/Linux/Cygwin/macOS */ - #include + #include /* This is the critical section object (statically allocated). */ #if defined(__APPLE__) #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER) - static pthread_mutex_t cs = PTHREAD_RECURSIVE_MUTEX_INITIALIZER; + static std::mutex cs; #else - static pthread_mutex_t cs = PTHREAD_MUTEX_INITIALIZER; + static std::mutex cs; #endif #else #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) - static pthread_mutex_t cs = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; + static std::mutex cs; #else - static pthread_mutex_t cs = PTHREAD_MUTEX_INITIALIZER; + static std::mutex cs; #endif #endif #endif @@ -2020,7 +2020,7 @@ namespace { DWORD pid = ::GetProcessId(process); #else pid_t pid = ::getpid(); - pthread_mutex_lock( &cs ); + cs.lock(); std::string tmp = "/tmp/"; #endif char sCount[13]; @@ -2032,7 +2032,7 @@ namespace { #if defined(_MSC_VER) || defined(__MINGW__) LeaveCriticalSection(&cs); #else - pthread_mutex_unlock( &cs ); + cs.unlock(); #endif return result; diff --git a/src/actions.hpp b/src/actions.hpp index 0e4fc062..5ac8f99c 100644 --- a/src/actions.hpp +++ b/src/actions.hpp @@ -65,7 +65,7 @@ namespace Action { class Task { public: //! Shortcut for an auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! Virtual destructor. virtual ~Task(); //! Virtual copy construction. @@ -149,7 +149,7 @@ namespace Action { public: virtual ~Print(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; //! Print the Jpeg comment @@ -204,7 +204,7 @@ namespace Action { public: virtual ~Rename(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; private: @@ -216,7 +216,7 @@ namespace Action { public: virtual ~Adjust(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; private: @@ -239,7 +239,7 @@ namespace Action { public: virtual ~Erase(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; /*! @@ -281,7 +281,7 @@ namespace Action { public: virtual ~Extract(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; /*! @@ -320,7 +320,7 @@ namespace Action { public: virtual ~Insert(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; /*! @@ -361,7 +361,7 @@ namespace Action { public: virtual ~Modify(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; Modify() {} //! Apply modification commands to the \em pImage, return 0 if successful. @@ -394,7 +394,7 @@ namespace Action { public: virtual ~FixIso(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; private: @@ -412,7 +412,7 @@ namespace Action { public: virtual ~FixCom(); virtual int run(const std::string& path); - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; AutoPtr clone() const; private: diff --git a/src/cr2image.cpp b/src/cr2image.cpp index e1d8be32..1d91e231 100644 --- a/src/cr2image.cpp +++ b/src/cr2image.cpp @@ -183,7 +183,7 @@ namespace Exiv2 { ed.end()); } - std::auto_ptr header(new Cr2Header(byteOrder)); + Auto_Ptr header(new Cr2Header(byteOrder)); OffsetWriter offsetWriter; offsetWriter.setOrigin(OffsetWriter::cr2RawIfdOffset, Cr2Header::offset2addr(), byteOrder); return TiffParserWorker::encode(io, diff --git a/src/crwimage_int.hpp b/src/crwimage_int.hpp index 84997d29..b36f8920 100644 --- a/src/crwimage_int.hpp +++ b/src/crwimage_int.hpp @@ -91,7 +91,7 @@ namespace Exiv2 { class CiffComponent { public: //! CiffComponent auto_ptr type - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! Container type to hold all metadata typedef std::vector Components; @@ -435,7 +435,7 @@ namespace Exiv2 { class CiffHeader { public: //! CiffHeader auto_ptr type - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ diff --git a/src/exif.cpp b/src/exif.cpp index 493fd20b..1ba4759f 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -80,7 +80,7 @@ namespace { class Thumbnail { public: //! Shortcut for a %Thumbnail auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Creators //@{ @@ -123,7 +123,7 @@ namespace { class TiffThumbnail : public Thumbnail { public: //! Shortcut for a %TiffThumbnail auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Manipulators //@{ @@ -147,7 +147,7 @@ namespace { class JpegThumbnail : public Thumbnail { public: //! Shortcut for a %JpegThumbnail auto pointer. - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! @name Manipulators //@{ @@ -192,8 +192,8 @@ namespace Exiv2 { template Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) { - std::auto_ptr > v - = std::auto_ptr >(new Exiv2::ValueType); + Auto_Ptr > v + = Auto_Ptr >(new Exiv2::ValueType); v->value_.push_back(value); exifDatum.value_ = v; return exifDatum; @@ -726,7 +726,7 @@ namespace Exiv2 { // Encode and check if the result fits into a JPEG Exif APP1 segment MemIo mio1; - std::auto_ptr header(new TiffHeader(byteOrder, 0x00000008, false)); + Auto_Ptr header(new TiffHeader(byteOrder, 0x00000008, false)); WriteMethod wm = TiffParserWorker::encode(mio1, pData, size, diff --git a/src/image.cpp b/src/image.cpp index 2fa41e5b..f4094c2f 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -938,7 +938,7 @@ namespace Exiv2 { Image::AutoPtr ImageFactory::create(int type, const std::string& path) { - std::auto_ptr fileIo(new FileIo(path)); + Auto_Ptr fileIo(new FileIo(path)); // Create or overwrite the file, then close it if (fileIo->open("w+b") != 0) { throw Error(kerFileOpenFailed, path, "w+b", strError()); @@ -954,7 +954,7 @@ namespace Exiv2 { Image::AutoPtr ImageFactory::create(int type, const std::wstring& wpath) { - std::auto_ptr fileIo(new FileIo(wpath)); + Auto_Ptr fileIo(new FileIo(wpath)); // Create or overwrite the file, then close it if (fileIo->open("w+b") != 0) { throw WError(kerFileOpenFailed, wpath, "w+b", strError().c_str()); diff --git a/src/orfimage.cpp b/src/orfimage.cpp index 2637ac6d..bcb336fe 100644 --- a/src/orfimage.cpp +++ b/src/orfimage.cpp @@ -195,7 +195,7 @@ namespace Exiv2 { ed.end()); } - std::auto_ptr header(new OrfHeader(byteOrder)); + Auto_Ptr header(new OrfHeader(byteOrder)); return TiffParserWorker::encode(io, pData, size, diff --git a/src/preview.cpp b/src/preview.cpp index ed45566c..d7627b42 100644 --- a/src/preview.cpp +++ b/src/preview.cpp @@ -93,7 +93,7 @@ namespace { virtual ~Loader() {} //! Loader auto pointer - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! Create a Loader subclass for requested id static AutoPtr create(PreviewId id, const Image &image); diff --git a/src/tiffcomposite_int.hpp b/src/tiffcomposite_int.hpp index 63812c1c..9e683ed9 100644 --- a/src/tiffcomposite_int.hpp +++ b/src/tiffcomposite_int.hpp @@ -174,7 +174,7 @@ namespace Exiv2 { class TiffComponent { public: //! TiffComponent auto_ptr type - typedef std::auto_ptr AutoPtr; + typedef Auto_Ptr AutoPtr; //! Container type to hold all metadata typedef std::vector Components; diff --git a/src/tifffwd_int.hpp b/src/tifffwd_int.hpp index 616c5a5f..47f27c2d 100644 --- a/src/tifffwd_int.hpp +++ b/src/tifffwd_int.hpp @@ -105,7 +105,7 @@ namespace Exiv2 { Use TiffComponent::AutoPtr, it is not used in this declaration only to reduce dependencies. */ - typedef std::auto_ptr (*NewTiffCompFct)(uint16_t tag, IfdId group); + typedef Auto_Ptr (*NewTiffCompFct)(uint16_t tag, IfdId group); //! Stack to hold a path from the TIFF root element to a TIFF entry typedef std::stack TiffPath; diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp index 21f67297..cd107584 100644 --- a/src/tiffimage.cpp +++ b/src/tiffimage.cpp @@ -292,7 +292,7 @@ namespace Exiv2 { ed.end()); } - std::auto_ptr header(new TiffHeader(byteOrder)); + Auto_Ptr header(new TiffHeader(byteOrder)); return TiffParserWorker::encode(io, pData, size, diff --git a/src/tiffimage_int.cpp b/src/tiffimage_int.cpp index df771629..cc96e880 100644 --- a/src/tiffimage_int.cpp +++ b/src/tiffimage_int.cpp @@ -1675,9 +1675,9 @@ namespace Exiv2 { ) { // Create standard TIFF header if necessary - std::auto_ptr ph; + Auto_Ptr ph; if (!pHeader) { - ph = std::auto_ptr(new TiffHeader); + ph = Auto_Ptr(new TiffHeader); pHeader = ph.get(); } TiffComponent::AutoPtr rootDir = parse(pData, size, root, pHeader); diff --git a/src/tiffimage_int.hpp b/src/tiffimage_int.hpp index c3fa5eee..e0bda5bf 100644 --- a/src/tiffimage_int.hpp +++ b/src/tiffimage_int.hpp @@ -256,7 +256,7 @@ namespace Exiv2 { component creation function. If the pointer that is returned is 0, then the TIFF entry should be ignored. */ - static std::auto_ptr create(uint32_t extendedTag, + static Auto_Ptr create(uint32_t extendedTag, IfdId group); /*! @brief Get the path, i.e., a list of extended tag and group pairs, from @@ -349,7 +349,7 @@ namespace Exiv2 { composite structure. If \em pData is 0 or \em size is 0, the return value is a 0 pointer. */ - static std::auto_ptr parse( + static Auto_Ptr parse( const byte* pData, uint32_t size, uint32_t root,