netpbm: fix build with ndk r22

Fixes error

```
util.c:47:1: error: redefinition of 'swab'
swab (const void *bfrom, void *bto, ssize_t n)
^
/home/builder/.termux-build/_cache/android-r22-api-24-v3/bin/../sysroot/usr/include/bits/swab.h:41:27: note: previous definition is here
__BIONIC_SWAB_INLINE void swab(const void* __void_src, void* __void_dst, ssize_t __byte_count) {
                          ^
1 error generated.
make[3]: *** [/home/builder/.termux-build/netpbm/src/common.mk:272: util.o] Error 1
make[3]: *** Waiting for unfinished jobs....

```
This commit is contained in:
Henrik Grimler 2020-12-26 11:11:03 +01:00
parent ac761539f0
commit aeaaa37637
2 changed files with 1 additions and 25 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Toolkit for manipulation of graphic images of different
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1:10.73.34
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/netpbm/super_stable/${TERMUX_PKG_VERSION:2}/netpbm-${TERMUX_PKG_VERSION:2}.tgz
TERMUX_PKG_SHA256=880bf47e68037e7d0f180032806ba05524138c7523b1e87309ad702a546a19fb
TERMUX_PKG_DEPENDS="libpng, libxml2, libjpeg-turbo, libtiff, zlib"

View File

@ -1,25 +0,0 @@
diff -u -r ../advanced/converter/other/cameratopam/util.c ./converter/other/cameratopam/util.c
--- ../advanced/converter/other/cameratopam/util.c 2014-12-29 02:10:41.516106336 -0500
+++ ./converter/other/cameratopam/util.c 2014-12-29 02:35:33.156107368 -0500
@@ -43,6 +43,21 @@
return a << 24 | b << 16 | c << 8 | d;
}
+static void
+swab (const void *bfrom, void *bto, ssize_t n)
+{
+ const char *from = (const char *) bfrom;
+ char *to = (char *) bto;
+
+ n &= ~((ssize_t) 1);
+ while (n > 1)
+ {
+ const char b0 = from[--n], b1 = from[--n];
+ to[n] = b0;
+ to[n + 1] = b1;
+ }
+}
+
/*
Faster than calling get2() multiple times.
*/