Skip to content

Commit

Permalink
msvc, mingw: fix compilation issues
Browse files Browse the repository at this point in the history
```
  ../src/arvnetwork.c(475): warning C4133: 'function': incompatible types - from 'DWORD *' to 'char *'
  ../src/arvnetwork.c(492): error C2121: '#': invalid character: possibly the result of a macro expansion
  ../src/arvnetwork.c(492): error C2146: syntax error: missing ')' before identifier 'ifndef'
  ../src/arvnetwork.c(492): error C2059: syntax error: ')'
```
  • Loading branch information
EmmanuelP committed Sep 4, 2024
1 parent 696e583 commit f3cd4ca
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/arvnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ arv_socket_set_recv_buffer_size (int socket_fd, gint buffer_size)
optlen = sizeof(buffer_size_reported);

result = setsockopt (socket_fd, SOL_SOCKET, SO_RCVBUF,
(const char*) &_buffer_size, sizeof (_buffer_size));
(const char *) &_buffer_size, sizeof (_buffer_size));
if(result != 0) {
arv_warning_interface ("[set_recv_buffer_size] Setting socket buffer to %d bytes failed (%s)",
_buffer_size, strerror(errno));
Expand All @@ -482,7 +482,7 @@ arv_socket_set_recv_buffer_size (int socket_fd, gint buffer_size)

/* setsockopt() succeeded, but sometimes the requested size is not actually be set. Ask
* to see the new setting to confirm. */
result = getsockopt (socket_fd, SOL_SOCKET, SO_RCVBUF, &buffer_size_reported, &optlen);
result = getsockopt (socket_fd, SOL_SOCKET, SO_RCVBUF, (char *) &buffer_size_reported, &optlen);
if (result != 0) {
arv_warning_interface ("[set_recv_buffer_size] Read of socket buffer size (SO_RCVBUF) failed (%s)",
strerror(errno));
Expand All @@ -492,14 +492,19 @@ arv_socket_set_recv_buffer_size (int socket_fd, gint buffer_size)

if(buffer_size_reported < buffer_size)
{
#ifndef G_OS_WIN32
arv_warning_interface ("[set_recv_buffer_size] Unexpected socket buffer size (SO_RCVBUF):"
" actual %d < expected %d bytes"
"\nYou might see missing packets and timeouts"
#ifndef G_OS_WIN32
"\nMost likely /proc/sys/net/core/rmem_max is too low"
"\nSee the socket(7) manpage\n"
"\nSee the socket(7) manpage\n",
buffer_size_reported, buffer_size);
#else
arv_warning_interface ("[set_recv_buffer_size] Unexpected socket buffer size (SO_RCVBUF):"
" actual %d < expected %d bytes"
"\nYou might see missing packets and timeouts",
buffer_size_reported, buffer_size);
#endif
, buffer_size_reported, buffer_size);

return FALSE;
}
Expand Down

0 comments on commit f3cd4ca

Please sign in to comment.