From 29cc33b916c06ab30ca42b4d39d663fcccac5e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Tue, 17 Sep 2013 23:38:31 +0300 Subject: libpng: Add WinRT compatibility A _WINRT_ macro is added for Windows Runtime and a few codepaths are changed with it. Change-Id: I99ca5636d03c39b0a05b7f75f13522d012fdec07 Done-with: Andrew Knight Reviewed-by: Oliver Wolff --- src/3rdparty/libpng/pngpriv.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h index f3441ee2a1..592d4ee0cb 100644 --- a/src/3rdparty/libpng/pngpriv.h +++ b/src/3rdparty/libpng/pngpriv.h @@ -362,6 +362,9 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ defined(_WIN32) || defined(__WIN32__) # include /* defines _WINDOWS_ macro */ +# if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY & WINAPI_FAMILY_DESKTOP_APP) == WINAPI_PARTITION_APP) +# define _WINRT_ /* Define a macro for Windows Runtime builds */ +# endif #endif /* Moved here around 1.5.0beta36 from pngconf.h */ @@ -371,7 +374,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; /* Memory model/platform independent fns */ #ifndef PNG_ABORT -# if defined(_WINDOWS_) || defined(_WIN32_WCE) +# if (defined(_WINDOWS_) || defined(_WIN32_WCE)) && !defined(_WINRT_) # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() @@ -389,7 +392,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; # define png_memcpy _fmemcpy # define png_memset _fmemset #else -# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */ +# if defined(_WINDOWS_) && !defined(_WINRT_) /* Favor Windows over C runtime fns */ # define CVT_PTR(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr) # define png_strlen lstrlenA -- cgit v1.2.3