Skip to content

Commit

Permalink
Fix windows cross build
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwag committed Mar 14, 2023
1 parent faead6a commit 72e3724
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modbus-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include "modbus-tcp.h"

#ifdef OS_WIN32
static int _modbus_tcp_init_win32(void)
static int _modbus_tcp_init_win32(modbus_t *ctx)
{
/* Initialise Windows Socket API */
WSADATA wsaData;
Expand Down Expand Up @@ -320,7 +320,7 @@ static int _modbus_tcp_connect(modbus_t *ctx)
int flags = SOCK_STREAM;

#ifdef OS_WIN32
if (_modbus_tcp_init_win32() == -1) {
if (_modbus_tcp_init_win32(ctx) == -1) {
return -1;
}
#endif
Expand Down Expand Up @@ -382,7 +382,7 @@ static int _modbus_tcp_pi_connect(modbus_t *ctx)
modbus_tcp_pi_t *ctx_tcp_pi = ctx->backend_data;

#ifdef OS_WIN32
if (_modbus_tcp_init_win32() == -1) {
if (_modbus_tcp_init_win32(ctx) == -1) {
return -1;
}
#endif
Expand Down Expand Up @@ -519,7 +519,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection)
ctx_tcp = ctx->backend_data;

#ifdef OS_WIN32
if (_modbus_tcp_init_win32() == -1) {
if (_modbus_tcp_init_win32(ctx) == -1) {
return -1;
}
#endif
Expand Down Expand Up @@ -593,7 +593,7 @@ int modbus_tcp_pi_listen(modbus_t *ctx, int nb_connection)
ctx_tcp_pi = ctx->backend_data;

#ifdef OS_WIN32
if (_modbus_tcp_init_win32() == -1) {
if (_modbus_tcp_init_win32(ctx) == -1) {
return -1;
}
#endif
Expand Down

0 comments on commit 72e3724

Please sign in to comment.