mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 05:17:07 +02:00
24 lines
806 B
Diff
24 lines
806 B
Diff
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
|
|
--- a/src/google/protobuf/stubs/port.h
|
|
+++ b/src/google/protobuf/stubs/port.h
|
|
@@ -93,7 +93,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
|
|
|
|
@@ -366,7 +366,7 @@
|
|
#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));
|