From 33188acf8f43f793a0c07f07c2388cbab1f9f758 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 16 Jun 2009 14:12:35 -0500 Subject: [PATCH] Eliminated PNG_LEGACY_SUPPORTED It is not of any use in libpng-1.4.0; it was only to support binary compatibility between some old libpng-1.0.x versions. It should have been removed from libpng-1.2.x as well but it is too late for that now. --- ANNOUNCE | 1 + CHANGES | 3 +++ png.h | 16 ++++------------ pngconf.h | 29 ----------------------------- pngrtran.c | 8 +------- pngtrans.c | 3 +-- 6 files changed, 10 insertions(+), 50 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index d837c94ba..a1bdbb4b1 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -482,6 +482,7 @@ version 1.4.0beta63 [June 16, 2009] available for ignoring known chunks even when not saving unknown chunks. Adopted preference for consistent use of "#ifdef" and "#ifndef" versus "#if defined()" and "if !defined()" where possible. + Eliminated PNG_LEGACY_SUPPORTED code. version 1.4.0betaN [future] Build shared libraries with -lz and sometimes -lm. diff --git a/CHANGES b/CHANGES index 58ffaa428..b0b4cdc8f 100644 --- a/CHANGES +++ b/CHANGES @@ -2160,6 +2160,9 @@ version 1.4.0beta63 [June 16, 2009] Adopted preference for consistent use of "#ifdef" and "#ifndef" versus "#if defined()" and "if !defined()" where possible. +version 1.4.0beta63 [June 16, 2009] + Eliminated PNG_LEGACY_SUPPORTED code. + version 1.4.0betaN [future] Build shared libraries with -lz and sometimes -lm. diff --git a/png.h b/png.h index 21b05fcda..3202ba370 100644 --- a/png.h +++ b/png.h @@ -1017,8 +1017,7 @@ typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, png_row_infop, png_bytep)); #endif @@ -1142,12 +1141,8 @@ struct png_struct_def png_byte sig_bytes; /* magic bytes read/written from start of file */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -#ifdef PNG_LEGACY_SUPPORTED - png_byte filler; /* filler byte for pixel expansion */ -#else png_uint_16 filler; /* filler bytes for pixel expansion */ #endif -#endif #if defined(PNG_bKGD_SUPPORTED) png_byte background_gamma_type; @@ -1870,21 +1865,18 @@ extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); #endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); diff --git a/pngconf.h b/pngconf.h index 3a05a4e69..9d458e20f 100644 --- a/pngconf.h +++ b/pngconf.h @@ -448,35 +448,6 @@ # endif #endif -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - /* Ignore attempt to turn off both floating and fixed point support */ #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ !defined(PNG_NO_FIXED_POINT_SUPPORTED) diff --git a/pngrtran.c b/pngrtran.c index c889e7573..21becbe2e 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -726,8 +726,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) void PNGAPI png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr read_user_transform_fn) @@ -739,11 +738,6 @@ png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr png_ptr->transformations |= PNG_USER_TRANSFORM; png_ptr->read_user_transform_fn = read_user_transform_fn; #endif -#ifdef PNG_LEGACY_SUPPORTED - if (read_user_transform_fn) - png_warning(png_ptr, - "This version of libpng does not support user transforms"); -#endif } #endif diff --git a/pngtrans.c b/pngtrans.c index e82905b73..e3df5c6d6 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -616,8 +616,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row) #endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) void PNGAPI png_set_user_transform_info(png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels) -- GitLab