You need to sign in before continuing.
Commit d0973adb163525d160b4fec22be0098c90b03cc1
1 parent
b8aea3c2
Fix compilation issue on Windows 7 (x64) with MinGW/MSYS and GCC 4.5
Reported by Patsy Kaye. Removed useless asignment at the same time.
Showing
2 changed files
with
6 additions
and
7 deletions
NEWS
| ... | ... | @@ -4,6 +4,8 @@ libmodbus 2.9.4 (2011-02-XX) |
| 4 | 4 | - IPv6 support |
| 5 | 5 | Make the TCP implementation "protocol independent" by Florian Forster |
| 6 | 6 | and Stéphane Raimbault. |
| 7 | +- Fix compilation on Windows 7 (x64) with MinGW/MSYS and GCC 4.5 | |
| 8 | + Reported by Patsy Kaye. | |
| 7 | 9 | |
| 8 | 10 | libmodbus 2.9.3 (2011-01-14) |
| 9 | 11 | ============================ | ... | ... |
src/modbus-tcp.c
| ... | ... | @@ -58,15 +58,12 @@ |
| 58 | 58 | #ifdef OS_WIN32 |
| 59 | 59 | static int _modbus_tcp_init_win32(void) |
| 60 | 60 | { |
| 61 | - // Initialise Win32 Socket API | |
| 62 | - WORD wVersionRequested; | |
| 61 | + /* Initialise Windows Socket API */ | |
| 63 | 62 | WSADATA wsaData; |
| 64 | 63 | |
| 65 | - wVersionRequested = MAKEWORD(2, 0); | |
| 66 | - if (WSAStartup(wVersionRequested, &wsaData) != 0) | |
| 67 | - { | |
| 68 | - fprintf (stderr, "WSAStartup() returned error code %d\n", | |
| 69 | - GetLastError()); | |
| 64 | + if (WSAStartup(MAKEWORD(2, 0), &wsaData) != 0) { | |
| 65 | + fprintf(stderr, "WSAStartup() returned error code %d\n", | |
| 66 | + (int)GetLastError()); | |
| 70 | 67 | errno = EIO; |
| 71 | 68 | return -1; |
| 72 | 69 | } | ... | ... |