Commit 1d3c6401f8186b54453ba64606758a90b6ec3fca

Authored by Stéphane Raimbault
1 parent c258137a

Add fallback to bswap_16 for gcc on Windows (closes #377)

Thanks to dreamflow for the issue.
Showing 1 changed file with 2 additions and 0 deletions
src/modbus-data.c
@@ -40,6 +40,8 @@ @@ -40,6 +40,8 @@
40 # define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10) 40 # define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10)
41 # if GCC_VERSION >= 430 41 # if GCC_VERSION >= 430
42 // Since GCC >= 4.30, GCC provides __builtin_bswapXX() alternatives so we switch to them 42 // Since GCC >= 4.30, GCC provides __builtin_bswapXX() alternatives so we switch to them
  43 +# undef bswap_16
  44 +# define bswap_16 __builtin_bswap16
43 # undef bswap_32 45 # undef bswap_32
44 # define bswap_32 __builtin_bswap32 46 # define bswap_32 __builtin_bswap32
45 # endif 47 # endif