Эх сурвалжийг харах

Improve ifdef around bswap_16 for __CYGWIN__

Stéphane Raimbault 8 жил өмнө
parent
commit
67cacf8c54
1 өөрчлөгдсөн 1 нэмэгдсэн , 3 устгасан
  1. 1 3
      src/modbus-data.c

+ 1 - 3
src/modbus-data.c

@@ -50,15 +50,13 @@
 #  define bswap_16 _byteswap_ushort
 #endif
 
-#if !defined(__CYGWIN__)
-#if !defined(bswap_16)
+#if !defined(__CYGWIN__) && !defined(bswap_16)
 #  warning "Fallback on C functions for bswap_16"
 static inline uint16_t bswap_16(uint16_t x)
 {
     return (x >> 8) | (x << 8);
 }
 #endif
-#endif
 
 #if !defined(bswap_32)
 #  warning "Fallback on C functions for bswap_32"