diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 9e13a7ee478de..a5752416b9f2d 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -27,7 +27,8 @@ #include #elif defined(__APPLE__) #include -#elif defined(__linux__) || defined(__ANDROID__) || defined(__CYGWIN__) +#elif !defined(__NVCC__) && \ + (defined(__linux__) || defined(__ANDROID__) || defined(__CYGWIN__)) #include // IWYU pragma: export #endif @@ -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) {