Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/google/protobuf/stubs/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <intrin.h>
#elif defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#elif defined(__linux__) || defined(__ANDROID__) || defined(__CYGWIN__)
#elif !defined(__NVCC__) && \
(defined(__linux__) || defined(__ANDROID__) || defined(__CYGWIN__))
#include <byteswap.h> // IWYU pragma: export
#endif

Expand Down Expand Up @@ -126,7 +127,8 @@ inline void GOOGLE_UNALIGNED_STORE64(void *p, uint64_t v) {
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)

#elif !defined(__linux__) && !defined(__ANDROID__) && !defined(__CYGWIN__)
#elif defined(__NVCC__) || \
(!defined(__linux__) && !defined(__ANDROID__) && !defined(__CYGWIN__))

#ifndef bswap_16
static inline uint16_t bswap_16(uint16_t x) {
Expand Down
Loading