aboutsummaryrefslogtreecommitdiffstats
path: root/main/protobuf/musl-fix.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-10-27 15:25:00 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-10-27 15:25:00 +0000
commit24f6a62b592ce88df64469ca5370f338669e8b95 (patch)
tree5175628da9a64a5468159a51e48ffda867ac5f47 /main/protobuf/musl-fix.patch
parent56b64ff614a9fe38cb860c944fd78709dc6d4f6f (diff)
downloadaports-24f6a62b592ce88df64469ca5370f338669e8b95.tar.bz2
aports-24f6a62b592ce88df64469ca5370f338669e8b95.tar.xz
main/protobuf: fix headers for musl
musl provides byteswap.h (and so does android apparently). so we assume its there if we are on linux.
Diffstat (limited to 'main/protobuf/musl-fix.patch')
-rw-r--r--main/protobuf/musl-fix.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/protobuf/musl-fix.patch b/main/protobuf/musl-fix.patch
new file mode 100644
index 0000000000..d7ab194a93
--- /dev/null
+++ b/main/protobuf/musl-fix.patch
@@ -0,0 +1,24 @@
+seems like both musl libc and android has byteswap.h
+
+diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
+index 376be5f..21223f4 100644
+--- a/src/google/protobuf/stubs/port.h
++++ b/src/google/protobuf/stubs/port.h
+@@ -87,7 +87,7 @@
+ #include <stdlib.h> // NOLINT(build/include)
+ #elif defined(__APPLE__)
+ #include <libkern/OSByteOrder.h>
+-#elif defined(__GLIBC__) || defined(__CYGWIN__)
++#elif defined(__linux__) || defined(__CYGWIN__)
+ #include <byteswap.h> // IWYU pragma: export
+ #endif
+
+@@ -299,7 +299,7 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64 v) {
+ #define bswap_32(x) OSSwapInt32(x)
+ #define bswap_64(x) OSSwapInt64(x)
+
+-#elif !defined(__GLIBC__) && !defined(__CYGWIN__)
++#elif !defined(__linux__) && !defined(__CYGWIN__)
+
+ static inline uint16 bswap_16(uint16 x) {
+ return static_cast<uint16>(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8));