From a051db3ff1a4d44138c149bb271f091f90ac98ec Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 18 Mar 2016 14:08:54 -0400 Subject: openjpeg: Remove unneeded non-standard code. When building with clang-cl and not passing /FIintrin.h, the __attribute__ defined to nothing, which confuses the compiler (see bug). Since nothing seems to require the __attribute__ redefinition, just remove it. Reported upstream here: https://github.com/uclouvain/openjpeg/issues/727 BUG=592745 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1810373002 . --- third_party/libopenjpeg20/0013-attrib_fix.patch | 18 ++++++++++++++++++ third_party/libopenjpeg20/README.pdfium | 5 +++-- third_party/libopenjpeg20/opj_includes.h | 6 ------ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 third_party/libopenjpeg20/0013-attrib_fix.patch (limited to 'third_party/libopenjpeg20') diff --git a/third_party/libopenjpeg20/0013-attrib_fix.patch b/third_party/libopenjpeg20/0013-attrib_fix.patch new file mode 100644 index 0000000000..4c1330420b --- /dev/null +++ b/third_party/libopenjpeg20/0013-attrib_fix.patch @@ -0,0 +1,18 @@ +diff --git a/third_party/libopenjpeg20/opj_includes.h b/third_party/libopenjpeg20/opj_includes.h +index f855b7c..5add091 100644 +--- a/third_party/libopenjpeg20/opj_includes.h ++++ b/third_party/libopenjpeg20/opj_includes.h +@@ -102,12 +102,6 @@ + ========================================================== + */ + +-/* Ignore GCC attributes if this is not GCC */ +-#ifndef __GNUC__ +- #define __attribute__(x) /* __attribute__(x) */ +-#endif +- +- + /* Are restricted pointers available? (C99) */ + #if (__STDC_VERSION__ != 199901L) + /* Not a C99 compiler */ + diff --git a/third_party/libopenjpeg20/README.pdfium b/third_party/libopenjpeg20/README.pdfium index cec6064ea2..a8f83c36a2 100644 --- a/third_party/libopenjpeg20/README.pdfium +++ b/third_party/libopenjpeg20/README.pdfium @@ -10,16 +10,17 @@ JPEG 2000 library. Local Modifications: 0000-use-colorspace.patch: Makes it possible to not call opj_jp2_apply_pclr(). -0001-image-data.patch: Fix a crashier in opj_j2k_update_image_data(). +0001-image-data.patch: Fix a crasher in opj_j2k_update_image_data(). 0002-packet-iterator.patch: Fix integer overflow in opj_pi_create_decode(). 0003-dwt-decode.patch: Check array bounds for opj_dwt_decode_1() and friends. 0004-j2k_read_mcc.patch: Move incrementing of l_tcp->m_nb_mcc_records to the right place. 0005-jp2_apply_pclr.patch: Fix out of bounds access. -0006-tcd_init_tile.patch: Fix a dividing zero bug in opj_tcd_init_tile(). +0006-tcd_init_tile.patch: Fix a divide by zero bug in opj_tcd_init_tile(). 0007-jp2_read_cmap.patch: Fix wrong rendering on greyscale images with index colorspace. 0008-jp2_check_color.patch: Replace an assertion with returning false. 0009-opj_pi_next.patch: Fix potential bad precno value in opj_pi_next* functions. 0010-pi_update_decode_poc.patch: Set proper upper bound for an array in opj_pi_update_decode_poc(). 0011-j2k_update_image_data.patch: Prevent bad signed -> unsigned casting. 0012-mct_sse.patch: Don't use SSE intrinsics in 32-bit builds. +0013-attrib_fix.patch: Don't needlessly redefine __attribute__, https://github.com/uclouvain/openjpeg/issues/727 TODO(thestig): List all the other patches. diff --git a/third_party/libopenjpeg20/opj_includes.h b/third_party/libopenjpeg20/opj_includes.h index f855b7c669..5add09188e 100644 --- a/third_party/libopenjpeg20/opj_includes.h +++ b/third_party/libopenjpeg20/opj_includes.h @@ -102,12 +102,6 @@ ========================================================== */ -/* Ignore GCC attributes if this is not GCC */ -#ifndef __GNUC__ - #define __attribute__(x) /* __attribute__(x) */ -#endif - - /* Are restricted pointers available? (C99) */ #if (__STDC_VERSION__ != 199901L) /* Not a C99 compiler */ -- cgit v1.2.3