diff --git a/ANNOUNCE b/ANNOUNCE index 3564d5418..3f10e3914 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.7.0alpha10 - January 21, 2013 +Libpng 1.7.0alpha10 - February 4, 2013 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -116,7 +116,10 @@ Version 1.7.0alpha08 [January 17, 2013] Version 1.7.0alpha09 [January 21, 2013] Pulled changes to multi-chunk handling from libpng-1.6.0beta40. -Version 1.7.0alpha10 [January 21, 2013] +Version 1.7.0alpha10 [February 4, 2013] + Make symbol prefixing work with the ARM neon optimizations. Also + allow pngpriv.h to be included for preprocessor definitions only, so + it can be used in non-C/C++ files. =========================================================================== NOTICE November 17, 2012: diff --git a/CHANGES b/CHANGES index 80cdb3a17..268fdc2d2 100644 --- a/CHANGES +++ b/CHANGES @@ -4402,7 +4402,10 @@ Version 1.7.0alpha08 [January 17, 2013] Version 1.7.0alpha09 [January 21, 2013] Pulled changes to multi-chunk handling from libpng-1.6.0beta40. -Version 1.7.0alpha10 [January 21, 2013] +Version 1.7.0alpha10 [February 4, 2013] + Make symbol prefixing work with the ARM neon optimizations. Also + allow pngpriv.h to be included for preprocessor definitions only, so + it can be used in non-C/C++ files. =========================================================================== NOTICE November 17, 2012: diff --git a/arm/filter_neon.S b/arm/filter_neon.S index 4aa500cd7..55ca3f292 100644 --- a/arm/filter_neon.S +++ b/arm/filter_neon.S @@ -10,6 +10,10 @@ * and license in png.h */ +/* This is required to get the symbol renames, which are #defines */ +#define PNG_VERSION_INFO_ONLY +#include "../pngpriv.h" + #ifdef __arm__ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ diff --git a/pngmem.c b/pngmem.c index 7fcb1dc6d..f6e6f3c64 100644 --- a/pngmem.c +++ b/pngmem.c @@ -154,10 +154,12 @@ png_realloc_array,(png_structrp png_ptr, png_const_voidp old_array, } } +#ifdef PNG_READ_SUPPORTED /* The potential overflow case. Set the cache counter so libpng will * not make any more attempts */ png_ptr->user_chunk_cache_max = 2; +#endif return NULL; /* error */ } diff --git a/pngpriv.h b/pngpriv.h index c677dfca1..37c08ec70 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -39,9 +39,11 @@ */ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ +#ifndef PNG_VERSION_INFO_ONLY /* Standard library headers not required by png.h: */ -#include -#include +# include +# include +#endif #define PNGLIB_BUILD /*libpng is being built, not used*/ @@ -177,10 +179,12 @@ # ifndef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); - typedef struct png_incomplete png_double; - typedef png_double* png_doublep; - typedef const png_double* png_const_doublep; - typedef png_double** png_doublepp; +# ifndef PNG_VERSION_INFO_ONLY + typedef struct png_incomplete png_double; + typedef png_double* png_doublep; + typedef const png_double* png_const_doublep; + typedef png_double** png_doublepp; +# endif # endif #endif #ifndef PNG_FIXED_EXPORT @@ -191,8 +195,6 @@ #endif #include "png.h" -#include "pngstruct.h" -#include "pnginfo.h" /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ #ifndef PNG_DLL_EXPORT @@ -238,11 +240,6 @@ # endif #endif -/* This is used for 16 bit gamma tables -- only the top level pointers are - * const; this could be changed: - */ -typedef const png_uint_16p * png_const_uint_16pp; - /* Moved to pngpriv.h at libpng-1.5.0 */ /* NOTE: some of these may have been used in external applications as * these definitions were exposed in pngconf.h prior to 1.5. @@ -536,19 +533,7 @@ typedef const png_uint_16p * png_const_uint_16pp; abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) -/* Added to libpng-1.5.7: sRGB conversion tables */ -#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\ - defined PNG_SIMPLIFIED_WRITE_SUPPORTED -#ifdef PNG_SIMPLIFIED_READ_SUPPORTED -PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); - /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, - * 0..65535. This table gives the closest 16-bit answers (no errors). - */ -#endif - -PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); -PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); - +/* See below for the definitions of the tables used in these macros */ #define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB @@ -690,6 +675,32 @@ PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); #define PNG_GAMMA_MAC_INVERSE 65909 #define PNG_GAMMA_sRGB_INVERSE 45455 +/* Almost everything below is C specific; the #defines above can be used in + * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. + */ +#ifndef PNG_VERSION_INFO_ONLY + +#include "pngstruct.h" +#include "pnginfo.h" + +/* This is used for 16 bit gamma tables -- only the top level pointers are + * const; this could be changed: + */ +typedef const png_uint_16p * png_const_uint_16pp; + +/* Added to libpng-1.5.7: sRGB conversion tables */ +#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\ + defined PNG_SIMPLIFIED_WRITE_SUPPORTED +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED +PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); + /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, + * 0..65535. This table gives the closest 16-bit answers (no errors). + */ +#endif + +PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); +PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); + /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus @@ -1890,4 +1901,5 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structrp png_ptr, } #endif +#endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */