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:
Enno Boland 2018-07-01 12:51:34 +02:00
parent f752326aa3
commit 623093bf51
No known key found for this signature in database
GPG key ID: D09964719BDE9971
2 changed files with 23 additions and 1 deletions

View 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));

View file

@ -1,7 +1,7 @@
# Template file for 'protobuf'
pkgname=protobuf
version=3.6.0.1
revision=1
revision=2
build_style=gnu-configure
hostmakedepends="automake libtool pkg-config"
makedepends="zlib-devel"