From caf5e39c2e68553101519fb4ce3664a73032d3a3 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 22 Aug 2017 07:20:55 -0400 Subject: Fix compiler warnings for clang/mac OS X --- libqpdf/Pl_DCT.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'libqpdf/Pl_DCT.cc') diff --git a/libqpdf/Pl_DCT.cc b/libqpdf/Pl_DCT.cc index e9ecccd9..68cdc973 100644 --- a/libqpdf/Pl_DCT.cc +++ b/libqpdf/Pl_DCT.cc @@ -4,6 +4,7 @@ #include #include #include +#include #if BITS_IN_JSAMPLE != 8 # error "qpdf does not support libjpeg built with BITS_IN_JSAMPLE != 8" @@ -112,17 +113,15 @@ Pl_DCT::compress(void* cinfo_p, PointerHolder b) struct jpeg_compress_struct* cinfo = reinterpret_cast(cinfo_p); -#ifdef __GNUC__ -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ + defined(__clang__)) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wold-style-cast" -# endif #endif jpeg_create_compress(cinfo); -#ifdef __GNUC__ -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ + defined(__clang__)) # pragma GCC diagnostic pop -# endif #endif unsigned char* outbuffer = 0; unsigned long outsize = 0; @@ -171,17 +170,15 @@ Pl_DCT::decompress(void* cinfo_p, PointerHolder b) struct jpeg_decompress_struct* cinfo = reinterpret_cast(cinfo_p); -#ifdef __GNUC__ -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ + defined(__clang__)) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wold-style-cast" -# endif #endif jpeg_create_decompress(cinfo); -#ifdef __GNUC__ -# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ + defined(__clang__)) # pragma GCC diagnostic pop -# endif #endif jpeg_mem_src(cinfo, b->getBuffer(), b->getSize()); -- cgit v1.2.3-54-g00ecf