protobuf: import alpine patch
musl provides byteswap.h (and so does android apparently). so we assume its there if we are on linux.
This commit is contained in:
parent
f752326aa3
commit
623093bf51
2 changed files with 23 additions and 1 deletions
22
srcpkgs/protobuf/patches/musl-fix.patch
Normal file
22
srcpkgs/protobuf/patches/musl-fix.patch
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
seems like both musl libc and android has byteswap.h
|
||||||
|
|
||||||
|
--- ./src/google/protobuf/stubs/port.h.orig 2018-07-01 12:46:31.204740205 +0200
|
||||||
|
+++ ./src/google/protobuf/stubs/port.h 2018-07-01 12:46:00.245986923 +0200
|
||||||
|
@@ -94,7 +94,7 @@
|
||||||
|
#include <intrin.h>
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
#include <libkern/OSByteOrder.h>
|
||||||
|
-#elif defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__)
|
||||||
|
+#elif defined(__linux__) || defined(__BIONIC__) || defined(__CYGWIN__)
|
||||||
|
#include <byteswap.h> // IWYU pragma: export
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -380,7 +380,7 @@ inline void GOOGLE_UNALIGNED_STORE64(voi
|
||||||
|
#define bswap_32(x) OSSwapInt32(x)
|
||||||
|
#define bswap_64(x) OSSwapInt64(x)
|
||||||
|
|
||||||
|
-#elif !defined(__GLIBC__) && !defined(__BIONIC__) && !defined(__CYGWIN__)
|
||||||
|
+#elif !defined(__linux__) && !defined(__BIONIC__) && !defined(__CYGWIN__)
|
||||||
|
|
||||||
|
static inline uint16 bswap_16(uint16 x) {
|
||||||
|
return static_cast<uint16>(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8));
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'protobuf'
|
# Template file for 'protobuf'
|
||||||
pkgname=protobuf
|
pkgname=protobuf
|
||||||
version=3.6.0.1
|
version=3.6.0.1
|
||||||
revision=1
|
revision=2
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
hostmakedepends="automake libtool pkg-config"
|
hostmakedepends="automake libtool pkg-config"
|
||||||
makedepends="zlib-devel"
|
makedepends="zlib-devel"
|
||||||
|
|
Loading…
Reference in a new issue