blob: 442ca20edb3f4112b16d6e9d871117b3e4a96243 (
plain) (
tree)
|
|
seems like both musl libc and android has byteswap.h
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -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));
|