Преглед на файлове

Avoid C99 declaration in win32 section code (closes #92)

Thanks to oldfaber and endrelovas.
Stéphane Raimbault преди 12 години
родител
ревизия
c429036883
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      src/modbus-tcp.c

+ 2 - 3
src/modbus-tcp.c

@@ -221,13 +221,12 @@ static int _modbus_tcp_set_ipv4_options(int s)
     /* If the OS does not offer SOCK_NONBLOCK, fall back to setting FIONBIO to
      * make sockets non-blocking */
     /* Do not care about the return value, this is optional */
+    option = 1;
 #if !defined(SOCK_NONBLOCK) && defined(FIONBIO)
 #ifdef OS_WIN32
     /* Setting FIONBIO expects an unsigned long according to MSDN */
-    unsigned long ioctloption = 1;
-    ioctlsocket(s, FIONBIO, &ioctloption);
+    ioctlsocket(s, FIONBIO, &option);
 #else
-    option = 1;
     ioctl(s, FIONBIO, &option);
 #endif
 #endif