summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libpng/qtpatches.diff
blob: 508d5874e443e296395aa70a9dbf2954083ced6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
index 3581f67919..e43862a886 100644
--- a/src/3rdparty/libpng/pngpriv.h
+++ b/src/3rdparty/libpng/pngpriv.h
@@ -23,6 +23,12 @@
 #ifndef PNGPRIV_H
 #define PNGPRIV_H
 
+#ifdef _MSC_VER
+#  ifndef _CRT_SECURE_NO_DEPRECATE
+#    define _CRT_SECURE_NO_DEPRECATE
+#  endif
+#endif
+
 /* Feature Test Macros.  The following are defined here to ensure that correctly
  * implemented libraries reveal the APIs libpng needs to build and hide those
  * that are not needed and potentially damaging to the compilation.
@@ -305,6 +311,11 @@
 #  endif
 #endif /* Setting PNG_BUILD_DLL if required */
 
+/* Modfied for usage in Qt: Do not export the libpng APIs */
+#ifdef PNG_BUILD_DLL
+#undef PNG_BUILD_DLL
+#endif
+
 /* See pngconf.h for more details: the builder of the library may set this on
  * the command line to the right thing for the specific compilation system or it
  * may be automagically set above (at present we know of no system where it does
@@ -543,6 +554,9 @@
 #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
     defined(_WIN32) || defined(__WIN32__)
 #  include <windows.h>  /* defines _WINDOWS_ macro */
+#  if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+#    define _WINRT_ /* Define a macro for Windows Runtime builds */
+#  endif
 #endif
 #endif /* PNG_VERSION_INFO_ONLY */
 
@@ -553,7 +567,7 @@
 
 /* Memory model/platform independent fns */
 #ifndef PNG_ABORT
-#  ifdef _WINDOWS_
+#  if (defined(_WINDOWS_) || defined(_WIN32_WCE)) && !defined(_WINRT_)
 #    define PNG_ABORT() ExitProcess(0)
 #  else
 #    define PNG_ABORT() abort()