Skip to content

Commit ca46171

Browse files
committed
3rdparty: libpng patch
1 parent d4e2e62 commit ca46171

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

3rdparty/libpng/opencv-libpng.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--- a/3rdparty/libpng/pngpriv.h
2+
+++ b/3rdparty/libpng/pngpriv.h
3+
@@ -214,7 +214,7 @@
4+
# endif
5+
#endif
6+
7+
-#if PNG_INTEL_SSE_OPT > 0
8+
+#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
9+
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
10+
# if defined(__SSE4_1__) || defined(__AVX__)
11+
/* We are not actually using AVX, but checking for AVX is the best
12+
@@ -547,7 +547,7 @@
13+
14+
/* Memory model/platform independent fns */
15+
#ifndef PNG_ABORT
16+
-# ifdef _WINDOWS_
17+
+# if defined(_WINDOWS_) && !defined(WINRT)
18+
# define PNG_ABORT() ExitProcess(0)
19+
# else
20+
# define PNG_ABORT() abort()
21+
@@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
22+
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
23+
#endif
24+
25+
-#if PNG_INTEL_SSE_IMPLEMENTATION > 0
26+
+#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
27+
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
28+
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
29+
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
30+
@@ -2099,7 +2099,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
31+
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
32+
#endif
33+
34+
-# if PNG_INTEL_SSE_IMPLEMENTATION > 0
35+
+# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
36+
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
37+
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
38+
# endif

3rdparty/libpng/pngpriv.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
# endif
215215
#endif
216216

217-
#if PNG_INTEL_SSE_OPT > 0
217+
#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
218218
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
219219
# if defined(__SSE4_1__) || defined(__AVX__)
220220
/* We are not actually using AVX, but checking for AVX is the best
@@ -547,7 +547,7 @@
547547

548548
/* Memory model/platform independent fns */
549549
#ifndef PNG_ABORT
550-
# ifdef _WINDOWS_
550+
# if defined(_WINDOWS_) && !defined(WINRT)
551551
# define PNG_ABORT() ExitProcess(0)
552552
# else
553553
# define PNG_ABORT() abort()
@@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
13401340
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
13411341
#endif
13421342

1343-
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
1343+
#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
13441344
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
13451345
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
13461346
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,
20992099
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
21002100
#endif
21012101

2102-
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
2102+
# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
21032103
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
21042104
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
21052105
# endif

0 commit comments

Comments
 (0)