minor fixes

eh

why apple why

why apple why
pull/66/head
despair 6 years ago
parent be7ac352ca
commit ae616d0fa5

@ -30,7 +30,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# turns off those annoying warnings for
# target-specific crypto code paths not
# applicable to the host's FPU -rick
add_compile_options(-Wall -Wextra -Werror -Wno-unknown-pragmas)
add_compile_options(-Wall -Wextra -Werror -Wno-unknown-pragmas -Wno-unknown-warning-option)
# vla are evil
add_compile_options(-Wvla)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
@ -48,7 +48,6 @@ else()
# found it. this is GNU only
add_compile_options(-Wno-cast-function-type)
endif(USING_CLANG)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
endif()
if(WIN32)

@ -11,6 +11,7 @@
#ifdef sizeof
#undef sizeof
#endif
namespace llarp
{
int
@ -203,9 +204,7 @@ namespace llarp
ssize_t
do_write(void* data, size_t sz)
{
DWORD x;
WriteFile(fd.tun, data, sz, &x, nullptr);
return x;
return tuntap_write(tunif, data, sz);
}
int
@ -337,7 +336,7 @@ struct llarp_win32_loop : public llarp_ev_loop
int
tick(int ms)
{
upoll_event events[1024];
upoll_event_t events[1024];
int result;
result = upoll_wait(upollfd, events, 1024, ms);
if(result > 0)
@ -375,7 +374,7 @@ struct llarp_win32_loop : public llarp_ev_loop
int
run()
{
upoll_event events[1024];
upoll_event_t events[1024];
int result;
do
{
@ -492,7 +491,7 @@ struct llarp_win32_loop : public llarp_ev_loop
bool
add_ev(llarp::ev_io* e, bool write)
{
upoll_event ev;
upoll_event_t ev;
ev.data.ptr = e;
ev.events = UPOLLIN | UPOLLERR;
if(write)

@ -1,4 +1,5 @@
#ifdef _WIN32
/* wake me up inside */
#pragma GCC diagnostic ignored "-Wvla"
/* emulated epoll, because the native async event system does not do
* particularly well with notification
@ -286,13 +287,13 @@ upoll_wait_select(upoll_t* upq, upoll_event_t* evs, int nev, int timeout)
nvec[nfds] = n;
if(n->event.events & UPOLLIN)
{
FD_SET(n->fd, &pollin);
FD_SET((SOCKET)n->fd, &pollin);
}
if(n->event.events & UPOLLOUT)
{
FD_SET(n->fd, &pollout);
FD_SET((SOCKET)n->fd, &pollout);
}
FD_SET(n->fd, &pollerr);
FD_SET((SOCKET)n->fd, &pollerr);
if(maxfd < n->fd)
maxfd = n->fd;
nfds++;

@ -429,7 +429,7 @@ tuntap_read(struct device *dev, void *buf, size_t size)
return -1;
}
}
return 0;
return x;
}
int
@ -448,7 +448,7 @@ tuntap_write(struct device *dev, void *buf, size_t size)
return -1;
}
}
return 0;
return x;
}
int

Loading…
Cancel
Save