From 0f4e5e9e28403f3681263e0c093ec87bdc3a49b8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Sep 2015 14:40:38 +0200 Subject: [PATCH] Suppress harmless MSVC C4324 warning in 64 bit builds We don't care about the change of size to wx_error_mgr struct due to the use of __declspec(align()) in libjpeg headers, so just suppress the warning. --- src/common/imagjpeg.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index cb4a319fc5..e215a7a76a 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -148,11 +148,26 @@ CPP_METHODDEF(void) wx_term_source ( j_decompress_ptr cinfo ) // JPEG error manager: +#ifdef __VISUALC__ + // We don't care about the size of this struct, but we still get an + // annoying warning C4324 here: + // + // 'wx_error_mgr' : structure was padded due to __declspec(align()) + // + // and suppressing it seems to be the only way to avoid it. + #pragma warning(push) + #pragma warning(disable: 4324) +#endif + struct wx_error_mgr : public jpeg_error_mgr { jmp_buf setjmp_buffer; /* for return to caller */ }; +#ifdef __VISUALC__ + #pragma warning(pop) +#endif + /* * Here's the routine that will replace the standard error_exit method: */