[libpng16] Ensure "__has_attribute()" macro exists before trying to use it with

old clang compilers (MacPorts Ticket #43939).
This commit is contained in:
Glenn Randers-Pehrson
2014-06-07 22:27:44 -05:00
parent ff3fb08157
commit 41694dcaea
3 changed files with 13 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.6.12rc02 - June 7, 2014
* libpng version 1.6.12rc02 - June 8, 2014
*
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -361,7 +361,7 @@
* version 1.2.41. Disabling these removes the warnings but may also produce
* less efficient code.
*/
# if defined(__clang__)
# if defined(__clang__) && defined(__has_attribute)
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))