Parcourir la source

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

Thanks to dreamflow for the issue.
Stéphane Raimbault il y a 8 ans
Parent
commit
1d3c6401f8
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      src/modbus-data.c

+ 2 - 0
src/modbus-data.c

@@ -40,6 +40,8 @@
 #  define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10)
 #  if GCC_VERSION >= 430
 // Since GCC >= 4.30, GCC provides __builtin_bswapXX() alternatives so we switch to them
+#    undef bswap_16
+#    define bswap_16 __builtin_bswap16
 #    undef bswap_32
 #    define bswap_32 __builtin_bswap32
 #  endif