Commit 67cacf8c54b41bf0f6b62398e75fe518505f964c

Authored by Stéphane Raimbault
1 parent 7ef3fa5f

Improve ifdef around bswap_16 for __CYGWIN__

Showing 1 changed file with 1 additions and 3 deletions
src/modbus-data.c
@@ -50,15 +50,13 @@ @@ -50,15 +50,13 @@
50 # define bswap_16 _byteswap_ushort 50 # define bswap_16 _byteswap_ushort
51 #endif 51 #endif
52 52
53 -#if !defined(__CYGWIN__)  
54 -#if !defined(bswap_16) 53 +#if !defined(__CYGWIN__) && !defined(bswap_16)
55 # warning "Fallback on C functions for bswap_16" 54 # warning "Fallback on C functions for bswap_16"
56 static inline uint16_t bswap_16(uint16_t x) 55 static inline uint16_t bswap_16(uint16_t x)
57 { 56 {
58 return (x >> 8) | (x << 8); 57 return (x >> 8) | (x << 8);
59 } 58 }
60 #endif 59 #endif
61 -#endif  
62 60
63 #if !defined(bswap_32) 61 #if !defined(bswap_32)
64 # warning "Fallback on C functions for bswap_32" 62 # warning "Fallback on C functions for bswap_32"