From dd6679dce8e03e8874ca758440b51c50d11d9890 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 20 Feb 2014 06:57:57 -0600 Subject: [PATCH] [libpng16] Check for __has_extension before using it in pngconf.h, to support older Clang versions (Jeremy Sequoia). --- ANNOUNCE | 6 ++++-- CHANGES | 4 +++- pngconf.h | 10 ++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index c4ffef07f..a3384d050 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.6.10beta02 - February 17, 2014 +Libpng 1.6.10beta02 - February 20, 2014 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. @@ -55,7 +55,7 @@ Version 1.6.10beta01 [February 9, 2014] and it adds corresponding code to pngimage.c to handle such options by not attempting to test them. -Version 1.6.10beta02 [February 17, 2014] +Version 1.6.10beta02 [February 20, 2014] Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng-calling applications. @@ -70,6 +70,8 @@ Version 1.6.10beta02 [February 17, 2014] run all the png_handle_*() and depend on them to return if info_ptr == NULL. This improves the performance of png_read_end(png_ptr, NULL) and makes it more robust against future programming errors. + Check for __has_extension before using it in pngconf.h, to + support older Clang versions (Jeremy Sequoia). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 3d1fa89f5..1a1b68a8d 100644 --- a/CHANGES +++ b/CHANGES @@ -4829,7 +4829,7 @@ Version 1.6.10beta01 [February 9, 2014] and it adds corresponding code to pngimage.c to handle such options by not attempting to test them. -Version 1.6.10beta02 [February 17, 2014] +Version 1.6.10beta02 [February 20, 2014] Moved redefines of png_error(), png_warning(), png_chunk_error(), and png_chunk_warning() from pngpriv.h to png.h to make them visible to libpng-calling applications. @@ -4844,6 +4844,8 @@ Version 1.6.10beta02 [February 17, 2014] run all the png_handle_*() and depend on them to return if info_ptr == NULL. This improves the performance of png_read_end(png_ptr, NULL) and makes it more robust against future programming errors. + Check for __has_extension before using it in pngconf.h, to + support older Clang versions (Jeremy Sequoia). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngconf.h b/pngconf.h index 8ab109e66..3c26c7963 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.10beta02 - February 9, 2014 + * libpng version 1.6.10beta02 - February 20, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -376,9 +376,11 @@ # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) -# if __has_extension(attribute_unavailable_with_message) -# define PNG_PRIVATE __attribute__((__unavailable__(\ - "This function is not exported by libpng."))) +# ifdef __has_extension +# if __has_extension(attribute_unavailable_with_message) +# define PNG_PRIVATE __attribute__((__unavailable__(\ + "This function is not exported by libpng."))) +# endif # endif # endif # ifndef PNG_RESTRICT