miniupnpc: fix include dir for linux, fix setsockopt warning on windows

This commit is contained in:
Brad Parker 2017-02-15 20:23:12 -05:00
parent 5d8c191df7
commit abc7da4c87
2 changed files with 3 additions and 3 deletions

View File

@ -1210,7 +1210,7 @@ ifeq ($(HAVE_NETWORKING), 1)
ifeq ($(HAVE_MINIUPNPC), 1)
ifeq ($(HAVE_BUILTINMINIUPNPC), 1)
DEFINES += -DHAVE_BUILTINMINIUPNPC -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR
DEFINES += -I$(DEPS_DIR)/miniupnpc
DEFINES += -I$(DEPS_DIR)
OBJ += \
$(DEPS_DIR)/miniupnpc/igd_desc_parse.o \
$(DEPS_DIR)/miniupnpc/upnpreplyparse.o \

View File

@ -197,13 +197,13 @@ int connecthostport(const char * host, unsigned short port,
/* setting a 3 seconds timeout for the connect() call */
timeout.tv_sec = 3;
timeout.tv_usec = 0;
if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(struct timeval)) < 0)
if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, sizeof(struct timeval)) < 0)
{
PRINT_SOCKET_ERROR("setsockopt");
}
timeout.tv_sec = 3;
timeout.tv_usec = 0;
if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(struct timeval)) < 0)
if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (const char *)&timeout, sizeof(struct timeval)) < 0)
{
PRINT_SOCKET_ERROR("setsockopt");
}