void-packages/srcpkgs/protobuf18/patches/musl-fix.patch
2020-02-28 19:43:51 -08:00

22 lines
911 B
Diff

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