Commit c90b8a25 authored by Manuel Günther's avatar Manuel Günther

Fixed issue with GIFLIB version>=5.1

parent ce850d33
...@@ -277,6 +277,15 @@ QuantizeBuffer(unsigned int Width, unsigned int Height, int *ColorMapSize, ...@@ -277,6 +277,15 @@ QuantizeBuffer(unsigned int Width, unsigned int Height, int *ColorMapSize,
#endif // End of ugly QuantizeBuffer definition for giflib 4.2 #endif // End of ugly QuantizeBuffer definition for giflib 4.2
static int DGifDeleter(GifFileType* ptr){
#if defined(GIF_LIB_VERSION) || (GIFLIB_MAJOR < 5) || (GIFLIB_MAJOR == 5) && (GIFLIB_MINOR < 1)
return DGifCloseFile(ptr);
#else
int error;
return DGifCloseFile(ptr, &error);
#endif
}
static boost::shared_ptr<GifFileType> make_dfile(const char *filename) static boost::shared_ptr<GifFileType> make_dfile(const char *filename)
{ {
#if defined(GIF_LIB_VERSION) || (GIFLIB_MAJOR < 5) #if defined(GIF_LIB_VERSION) || (GIFLIB_MAJOR < 5)
...@@ -290,7 +299,17 @@ static boost::shared_ptr<GifFileType> make_dfile(const char *filename) ...@@ -290,7 +299,17 @@ static boost::shared_ptr<GifFileType> make_dfile(const char *filename)
m % filename; m % filename;
throw std::runtime_error(m.str()); throw std::runtime_error(m.str());
} }
return boost::shared_ptr<GifFileType>(fp, DGifCloseFile); return boost::shared_ptr<GifFileType>(fp, DGifDeleter);
}
static int EGifDeleter(GifFileType* ptr){
#if defined(GIF_LIB_VERSION) || (GIFLIB_MAJOR < 5) || (GIFLIB_MAJOR == 5) && (GIFLIB_MINOR < 1)
return EGifCloseFile(ptr);
#else
int error;
return EGifCloseFile(ptr, &error);
#endif
} }
static boost::shared_ptr<GifFileType> make_efile(const char *filename) static boost::shared_ptr<GifFileType> make_efile(const char *filename)
...@@ -306,7 +325,7 @@ static boost::shared_ptr<GifFileType> make_efile(const char *filename) ...@@ -306,7 +325,7 @@ static boost::shared_ptr<GifFileType> make_efile(const char *filename)
m % filename; m % filename;
throw std::runtime_error(m.str()); throw std::runtime_error(m.str());
} }
return boost::shared_ptr<GifFileType>(fp, EGifCloseFile); return boost::shared_ptr<GifFileType>(fp, EGifDeleter);
} }
/** /**
......
...@@ -17,6 +17,7 @@ develop = src/bob.extension ...@@ -17,6 +17,7 @@ develop = src/bob.extension
; options for bob.buildout extension ; options for bob.buildout extension
debug = true debug = true
verbose = true verbose = true
newest = false
[sources] [sources]
bob.extension = git https://github.com/bioidiap/bob.extension bob.extension = git https://github.com/bioidiap/bob.extension
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment