Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim-petukhov committed Jul 21, 2023
1 parent 2e4ae2e commit 53e00d9
Showing 1 changed file with 8 additions and 2 deletions.
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 __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 53e00d9

Please sign in to comment.