Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
fix again
  • Loading branch information
maksim-petukhov committed Jul 21, 2023
1 parent 2e4ae2e commit acef2a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/osgPlugins/dae/ReaderWriterDAE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex)

#if __cplusplus > 199711L
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 199711L) || __cplusplus >= 199711L)
#define smart_ptr std::unique_ptr
#else
#define smart_ptr std::auto_ptr
Expand Down
9 changes: 7 additions & 2 deletions src/osgPlugins/ffmpeg/FFmpegImageStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

#define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10

#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 199711L) || __cplusplus >= 199711L)
#define smart_ptr std::unique_ptr
#else
#define smart_ptr std::auto_ptr
#endif

namespace osgFFmpeg {

Expand All @@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() :
{
setOrigin(osg::Image::TOP_LEFT);

std::auto_ptr<FFmpegDecoder> decoder(new FFmpegDecoder);
std::auto_ptr<CommandQueue> commands(new CommandQueue);
smart_ptr<FFmpegDecoder> decoder(new FFmpegDecoder);
smart_ptr<CommandQueue> commands(new CommandQueue);

m_decoder = decoder.release();
m_commands = commands.release();
Expand Down
10 changes: 8 additions & 2 deletions src/osgPlugins/gdal/ReaderWriterGDAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@

#define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex)

#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 199711L) || __cplusplus >= 199711L)
#define smart_ptr std::unique_ptr
#else
#define smart_ptr std::auto_ptr
#endif

// From easyrgb.com
float Hue_2_RGB( float v1, float v2, float vH )
{
Expand Down Expand Up @@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter

initGDAL();

std::auto_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly));
smart_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly));
if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED;

int dataWidth = dataset->GetRasterXSize();
Expand Down Expand Up @@ -577,7 +583,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter

initGDAL();

std::auto_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly));
smart_ptr<GDALDataset> dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly));
if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED;

int dataWidth = dataset->GetRasterXSize();
Expand Down

0 comments on commit acef2a5

Please sign in to comment.