From ca1d4ca82d3eff0d1cbc645bb21da5e709c1ad57 Mon Sep 17 00:00:00 2001 From: Ashish Kulkarni Date: Thu, 18 Dec 2014 20:58:23 +0530 Subject: fix build on MSVC with --system-libpng or --system-libjpeg This was introduced in WebKit r108792, as in the related bug https://bugs.webkit.org/show_bug.cgi?id=32410#c26 it was confirmed as broken for Windows MSVC (for Chromium). The final merge made it conditional for PLATFORM(QT) but did not fix the underlying issue, which was the wrong placement of NO_RETURN as MSVC does not allow __declspec(noreturn) to be put after the declaration but GCC allows __attribute((__noreturn__)) at either location. This is similar with the usage of NO_RETURN in other places. Change-Id: I95ae3727553093b84b3645eb6dad63779f08e09d Reviewed-by: Kai Koehne Reviewed-by: Allan Sandfeld Jensen --- Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp | 6 +----- Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index d15dce2da..7da75c874 100644 --- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp @@ -104,11 +104,7 @@ void init_source(j_decompress_ptr jd); boolean fill_input_buffer(j_decompress_ptr jd); void skip_input_data(j_decompress_ptr jd, long num_bytes); void term_source(j_decompress_ptr jd); -#if PLATFORM(QT) -void error_exit(j_common_ptr) NO_RETURN; -#else -void error_exit(j_common_ptr cinfo); -#endif +NO_RETURN void error_exit(j_common_ptr cinfo); // Implementation of a JPEG src object that understands our state machine struct decoder_source_mgr { diff --git a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp index 776acce2b..b17d681f9 100644 --- a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp +++ b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp @@ -67,9 +67,7 @@ const double cInverseGamma = 0.45455; const unsigned long cMaxPNGSize = 1000000UL; // Called if the decoding of the image fails. -#if PLATFORM(QT) -static void PNGAPI decodingFailed(png_structp, png_const_charp) NO_RETURN; -#endif +static NO_RETURN void PNGAPI decodingFailed(png_structp, png_const_charp); static void PNGAPI decodingFailed(png_structp png, png_const_charp) { longjmp(JMPBUF(png), 1); -- cgit v1.2.3