diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-09-06 10:49:40 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-09-06 10:55:40 +0200 |
commit | a6b6e760ac2f019b9ca42847b9535207966811aa (patch) | |
tree | cdba2823eb3708f7a40593ff69b81d2be88515ea /src/gui/image | |
parent | 48ba459580c9e4ce28dbb2c3ce433175148da5a1 (diff) | |
parent | 8ed47d961dc7e6f161030654d11cd330a542eadf (diff) |
Merge remote branch 'gerrit/master' into HEAD
Conflicts:
configure.exe
src/corelib/global/qglobal.h
src/gui/kernel/qplatformnativeinterface_qpa.h
src/gui/widgets/qlinecontrol.cpp
src/gui/widgets/qmenu_mac.mm
src/gui/widgets/qmenu_p.h
src/gui/widgets/qmenubar.cpp
src/gui/widgets/qmenubar_p.h
src/gui/widgets/widgets.pri
src/plugins/platforms/wayland/qwaylandnativeinterface.cpp
src/plugins/platforms/wayland/qwaylandnativeinterface.h
src/src.pro
tests/auto/qdir/tst_qdir.cpp
tests/auto/qfileinfo/tst_qfileinfo.cpp
tests/auto/qsslsocket/tst_qsslsocket.cpp
tests/auto/qstring/tst_qstring.cpp
Change-Id: I64cf2cefa532ba87a92f632e3595ce6914183e9b
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index f7d07a5b14..1714442eb6 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -58,6 +58,29 @@ #include <pngconf.h> #endif +#if PNG_LIBPNG_VER >= 10400 && PNG_LIBPNG_VER <= 10502 \ + && defined(PNG_PEDANTIC_WARNINGS_SUPPORTED) +/* + Versions 1.4.0 to 1.5.2 of libpng declare png_longjmp_ptr to + have a noreturn attribute if PNG_PEDANTIC_WARNINGS_SUPPORTED + is enabled, but most declarations of longjmp in the wild do + not add this attribute. This causes problems when the png_jmpbuf + macro expands to calling png_set_longjmp_fn with a mismatched + longjmp, as compilers such as Clang will treat this as an error. + + To work around this we override the png_jmpbuf macro to cast + longjmp to a png_longjmp_ptr. +*/ +# undef png_jmpbuf +# ifdef PNG_SETJMP_SUPPORTED +# define png_jmpbuf(png_ptr) \ + (*png_set_longjmp_fn((png_ptr), (png_longjmp_ptr)longjmp, sizeof(jmp_buf))) +# else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) +# endif +#endif + #ifdef Q_OS_WINCE #define CALLBACK_CALL_TYPE __cdecl #else |