From ca46171246cac524af4ce81146cbc5f304fee15c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 7 Dec 2017 19:16:11 +0300 Subject: [PATCH] 3rdparty: libpng patch --- 3rdparty/libpng/opencv-libpng.patch | 38 +++++++++++++++++++++++++++++ 3rdparty/libpng/pngpriv.h | 8 +++--- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 3rdparty/libpng/opencv-libpng.patch diff --git a/3rdparty/libpng/opencv-libpng.patch b/3rdparty/libpng/opencv-libpng.patch new file mode 100644 index 0000000000..e760e8d89f --- /dev/null +++ b/3rdparty/libpng/opencv-libpng.patch @@ -0,0 +1,38 @@ +--- a/3rdparty/libpng/pngpriv.h ++++ b/3rdparty/libpng/pngpriv.h +@@ -214,7 +214,7 @@ + # endif + #endif + +-#if PNG_INTEL_SSE_OPT > 0 ++#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0 + # ifndef PNG_INTEL_SSE_IMPLEMENTATION + # if defined(__SSE4_1__) || defined(__AVX__) + /* We are not actually using AVX, but checking for AVX is the best +@@ -547,7 +547,7 @@ + + /* Memory model/platform independent fns */ + #ifndef PNG_ABORT +-# ifdef _WINDOWS_ ++# if defined(_WINDOWS_) && !defined(WINRT) + # define PNG_ABORT() ExitProcess(0) + # else + # define PNG_ABORT() abort() +@@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + #endif + +-#if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop + row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); + PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop +@@ -2099,7 +2099,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa, + (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); + #endif + +-# if PNG_INTEL_SSE_IMPLEMENTATION > 0 ++# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 + PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, + (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); + # endif \ No newline at end of file diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h index 1f2e90f2b3..4e7278f174 100644 --- a/3rdparty/libpng/pngpriv.h +++ b/3rdparty/libpng/pngpriv.h @@ -214,7 +214,7 @@ # endif #endif -#if PNG_INTEL_SSE_OPT > 0 +#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0 # ifndef PNG_INTEL_SSE_IMPLEMENTATION # if defined(__SSE4_1__) || defined(__AVX__) /* We are not actually using AVX, but checking for AVX is the best @@ -547,7 +547,7 @@ /* Memory model/platform independent fns */ #ifndef PNG_ABORT -# ifdef _WINDOWS_ +# if defined(_WINDOWS_) && !defined(WINRT) # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() @@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); #endif -#if PNG_INTEL_SSE_IMPLEMENTATION > 0 +#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop @@ -2099,7 +2099,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); #endif -# if PNG_INTEL_SSE_IMPLEMENTATION > 0 +# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); # endif