Commit 876a8d0d83563bebe91f6f3b27c73babc4cd17d4
Committed by
Stéphane Raimbault
1 parent
e28361f7
Workaround for missing definition of ENOTSUP on Win32
The ENOTSUP error code is not defined on Win32. However we can simply use an equivalent from the Windows Socket API (WSA). Fixes Win32 build with recent versions of libmodbus.
Showing
1 changed file
with
2 additions
and
0 deletions
src/modbus-rtu-private.h
| @@ -38,6 +38,8 @@ | @@ -38,6 +38,8 @@ | ||
| 38 | #define _MODBUS_RTU_CHECKSUM_LENGTH 2 | 38 | #define _MODBUS_RTU_CHECKSUM_LENGTH 2 |
| 39 | 39 | ||
| 40 | #if defined(_WIN32) | 40 | #if defined(_WIN32) |
| 41 | +#define ENOTSUP WSAEOPNOTSUPP | ||
| 42 | + | ||
| 41 | /* WIN32: struct containing serial handle and a receive buffer */ | 43 | /* WIN32: struct containing serial handle and a receive buffer */ |
| 42 | #define PY_BUF_SIZE 512 | 44 | #define PY_BUF_SIZE 512 |
| 43 | struct win32_ser { | 45 | struct win32_ser { |