]> git.sesse.net Git - vlc/commitdiff
contrib: png: use standard functions
authorRafaël Carré <funman@videolan.org>
Thu, 9 May 2013 13:20:11 +0000 (15:20 +0200)
committerRafaël Carré <funman@videolan.org>
Thu, 9 May 2013 13:20:52 +0000 (15:20 +0200)
Those Windows functions bring no benefit and are forbidden in Windows Store apps

contrib/src/png/rules.mak
contrib/src/png/winrt.patch [new file with mode: 0644]

index b9b464617a05de2005e0a19b42d6c5e7ce5a8727..9ea3bb971a9f19103e0569f6f67629a0a0c7ea5e 100644 (file)
@@ -14,6 +14,7 @@ $(TARBALLS)/libpng-$(PNG_VERSION).tar.bz2:
 
 png: libpng-$(PNG_VERSION).tar.bz2 .sum-png
        $(UNPACK)
+       $(APPLY) $(SRC)/png/winrt.patch
        $(MOVE)
 
 DEPS_png = zlib $(DEPS_zlib)
diff --git a/contrib/src/png/winrt.patch b/contrib/src/png/winrt.patch
new file mode 100644 (file)
index 0000000..16cde06
--- /dev/null
@@ -0,0 +1,23 @@
+--- png/pngpriv.h.orig 2013-05-09 15:17:34.933583625 +0200
++++ png/pngpriv.h      2013-05-09 15:18:33.981581142 +0200
+@@ -360,11 +360,7 @@
+ /* Memory model/platform independent fns */
+ #ifndef PNG_ABORT
+-#  ifdef _WINDOWS_
+-#    define PNG_ABORT() ExitProcess(0)
+-#  else
+ #    define PNG_ABORT() abort()
+-#  endif
+ #endif
+ #ifdef USE_FAR_KEYWORD
+@@ -381,7 +377,7 @@
+ #  ifdef _WINDOWS_  /* Favor Windows over C runtime fns */
+ #    define CVT_PTR(ptr)         (ptr)
+ #    define CVT_PTR_NOCHECK(ptr) (ptr)
+-#    define png_strlen  lstrlenA
++#    define png_strlen  strlen
+ #    define png_memcmp  memcmp
+ #    define png_memcpy  CopyMemory
+ #    define png_memset  memset