diff --git a/NEWS b/NEWS index bf1937e..33956e4 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ libmodbus 2.9.4 (2011-02-XX) - IPv6 support Make the TCP implementation "protocol independent" by Florian Forster and Stéphane Raimbault. +- Fix compilation on Windows 7 (x64) with MinGW/MSYS and GCC 4.5 + Reported by Patsy Kaye. libmodbus 2.9.3 (2011-01-14) ============================ diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index 874ae35..df68738 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -58,15 +58,12 @@ #ifdef OS_WIN32 static int _modbus_tcp_init_win32(void) { - // Initialise Win32 Socket API - WORD wVersionRequested; + /* Initialise Windows Socket API */ WSADATA wsaData; - wVersionRequested = MAKEWORD(2, 0); - if (WSAStartup(wVersionRequested, &wsaData) != 0) - { - fprintf (stderr, "WSAStartup() returned error code %d\n", - GetLastError()); + if (WSAStartup(MAKEWORD(2, 0), &wsaData) != 0) { + fprintf(stderr, "WSAStartup() returned error code %d\n", + (int)GetLastError()); errno = EIO; return -1; }