[libpng16] Add more conditionals for compiling png_fixed().

This is a small function, but avoiding compiling it also avoids needing
to link with "-lm" unnecessarily.
This commit is contained in:
Glenn Randers-Pehrson 2012-08-10 12:56:57 -05:00
parent ba2dd33d9c
commit 6954141484
2 changed files with 13 additions and 3 deletions

7
png.c
View File

@ -2978,7 +2978,12 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
#endif /* READ_SCAL */ #endif /* READ_SCAL */
#if defined(PNG_FLOATING_POINT_SUPPORTED) && \ #if defined(PNG_FLOATING_POINT_SUPPORTED) && \
!defined(PNG_FIXED_POINT_MACRO_SUPPORTED) !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
(defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \
defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \
defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
(defined(PNG_sCAL_SUPPORTED) && \
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
png_fixed_point png_fixed_point
png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text) png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
{ {

View File

@ -749,8 +749,13 @@ PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr,
/* Free the buffer list used by the compressed write code. */ /* Free the buffer list used by the compressed write code. */
#endif #endif
#if defined PNG_FLOATING_POINT_SUPPORTED &&\ #if defined(PNG_FLOATING_POINT_SUPPORTED) && \
!defined PNG_FIXED_POINT_MACRO_SUPPORTED !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
(defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \
defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \
defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
(defined(PNG_sCAL_SUPPORTED) && \
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr,
double fp, png_const_charp text),PNG_EMPTY); double fp, png_const_charp text),PNG_EMPTY);
#endif #endif