Skip to content

Commit 13a0018

Browse files
fix
fix again fix one more time
1 parent 2e4ae2e commit 13a0018

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/osgPlugins/dae/ReaderWriterDAE.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

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

35-
#if __cplusplus > 199711L
35+
#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L)
3636
#define smart_ptr std::unique_ptr
3737
#else
3838
#define smart_ptr std::auto_ptr

src/osgPlugins/ffmpeg/FFmpegImageStream.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
#define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10
1212

13+
#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L)
14+
#define smart_ptr std::unique_ptr
15+
#else
16+
#define smart_ptr std::auto_ptr
17+
#endif
1318

1419
namespace osgFFmpeg {
1520

@@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() :
2328
{
2429
setOrigin(osg::Image::TOP_LEFT);
2530

26-
std::auto_ptr<FFmpegDecoder> decoder(new FFmpegDecoder);
27-
std::auto_ptr<CommandQueue> commands(new CommandQueue);
31+
smart_ptr<FFmpegDecoder> decoder(new FFmpegDecoder);
32+
smart_ptr<CommandQueue> commands(new CommandQueue);
2833

2934
m_decoder = decoder.release();
3035
m_commands = commands.release();

src/osgPlugins/gdal/ReaderWriterGDAL.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434

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

37+
#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L)
38+
#define smart_ptr std::unique_ptr
39+
#else
40+
#define smart_ptr std::auto_ptr
41+
#endif
42+
3743
// From easyrgb.com
3844
float Hue_2_RGB( float v1, float v2, float vH )
3945
{
@@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
123129

124130
initGDAL();
125131

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

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

578584
initGDAL();
579585

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

583589
int dataWidth = dataset->GetRasterXSize();

0 commit comments

Comments
 (0)