#220 __has_extension not not be used on older versions of clang that don't support it

libpng_code
closed-fixed
nobody
None
5
2014-06-01
2014-02-20
No

/opt/local/include/libpng16/pngconf.h:379:26: error: token is not a valid binary operator in a preprocessor subexpression

if __has_extension(attribute_unavailable_with_message)

      ~~~~~~~~~~~~~~~^

This occurred when using the version of clang in the Xcode 3.2.6 for Snow Leopard:
$ /usr/bin/clang --version
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix


For compatibility, make sure you do:

ifndef __has_extension

define __has_extension(x) 0

endif

Discussion

  • Glenn Randers-Pehrson

    • status: open --> open-accepted
     
  • Glenn Randers-Pehrson

    Thanks. Fix pushed to the libpng16 and libpng17 branches of the libpng GIT repository.

     
  • Glenn Randers-Pehrson

    • status: open-accepted --> closed-fixed
     
  • Glenn Randers-Pehrson

    Fixed in libpng-1.6.10.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks