Skip to content

Commit

Permalink
use defined() to check if a variable is defined, also, rename it to b…
Browse files Browse the repository at this point in the history
…e clearer about a feature availability and not enabling one
  • Loading branch information
rmottola committed Oct 26, 2023
1 parent 31a71a1 commit 34c5a5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/NSBitmapImageRep+GIF.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
// GifQuantizeBuffer is considered private API on GIF 5.2 and later:
// https://sourceforge.net/p/giflib/code/ci/befe188771035de7acbc2ad46bea22ea73ab09cd/
#if (GIFLIB_MAJOR == 5 && GIFLIB_MINOR < 2) || GIFLIB_MAJOR < 5
#define PUBLIC_QUANTIZEBUFFER
#define IS_QUANTIZEBUFFER_PUBLIC
#endif

/* -----------------------------------------------------------
Expand Down Expand Up @@ -134,7 +134,7 @@ static void gs_gif_init_input_source(gs_gif_input_src *src, NSData *data)
src->pos = 0;
}

#if (HAVE_QUANTIZEBUFFER || HAVE_GIFQUANTIZEBUFFER) && PUBLIC_QUANTIZEBUFFER
#if (defined(HAVE_QUANTIZEBUFFER) || defined(HAVE_GIFQUANTIZEBUFFER)) && defined(IS_QUANTIZEBUFFER_PUBLIC)
/* Function to write GIF to buffer */
static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len)
{
Expand Down Expand Up @@ -410,7 +410,7 @@ - (id) _initBitmapFromGIF: (NSData *)imageData
- (NSData *) _GIFRepresentationWithProperties: (NSDictionary *) properties
errorMessage: (NSString **)errorMsg
{
#if (HAVE_QUANTIZEBUFFER || HAVE_GIFQUANTIZEBUFFER) && PUBLIC_QUANTIZEBUFFER
#if (defined(HAVE_QUANTIZEBUFFER) || defined(HAVE_GIFQUANTIZEBUFFER)) && defined(IS_QUANTIZEBUFFER_PUBLIC)
NSMutableData * GIFRep = nil; // our return value
GifFileType * GIFFile = NULL;
GifByteType * rgbPlanes = NULL; // giflib needs planar RGB
Expand Down

0 comments on commit 34c5a5e

Please sign in to comment.