From c42903688389fbe3a580ba252e262bec35e930bd Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Mon, 25 Feb 2013 02:11:38 +0100 Subject: [PATCH] Avoid C99 declaration in win32 section code (closes #92) --- src/modbus-tcp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index e50cfc8..017026b 100644 --- a/src/modbus-tcp.c +++ b/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 -- libgit2 0.21.4