Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix cases where GIF_LIB_VERSION is not defined

Versions up to 4.1.6 of GIFLIB defined a GIF_LIB_VERSION macro that was string-valued.
Versions after 4.1.6 define integer-valued GIFLIB_MAJOR, GIFLIB_MINOR, and GIFLIB_RELEASE macros for the three components of the version.

Check for GIF_LIB_VERSION, otherwise use the new macros.
  • Loading branch information...
commit 25234db5df31384ed7d24ccdec1cb68f2fe83855 1 parent 19bcf35
Luigi Pinca lpinca authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/
7 src/
@@ -51,9 +51,16 @@ init (Handle<Object> target) {
target->Set(String::New("jpegVersion"), String::New(jpeg_version));
#ifdef HAVE_GIF
+ char gif_version[10];
+ snprintf(gif_version, 10, "%d.%d.%d", GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE);
+ target->Set(String::New("gifVersion"), String::New(gif_version));
target->Set(String::New("gifVersion"), String::New(GIF_LIB_VERSION));
Please sign in to comment.
Something went wrong with that request. Please try again.