Fix Cross Compilation (#7077)

* Fix a few libraries for functional cross compilation

* include timeval
This commit is contained in:
BMagnu authored and GitHub committed 2025-10-06 14:12:40 +00:00
1 parent 84d3cdf847
commit 2808606b84
7 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ if (WIN32)
target_compile_definitions(pcpnatpmp PRIVATE HAVE_GETTIMEOFDAY)
endif(MINGW)
target_link_libraries (pcpnatpmp INTERFACE ws2_32.lib Iphlpapi.lib)
target_link_libraries (pcpnatpmp INTERFACE ws2_32.lib iphlpapi.lib)
endif ()
suppress_warnings(pcpnatpmp)
+1 -1
View File
@@ -58,7 +58,7 @@
#include <winsock2.h>
#include <ws2ipdef.h>
#include <Iphlpapi.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
+1 -1
View File
@@ -528,7 +528,7 @@ static ssize_t pcp_socket_sendto_impl(PCP_SOCKET sock, const void *buf,
if (WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &WSARecvMsg_GUID,
sizeof(GUID), &WSARecvMsg, sizeof(WSARecvMsg),
&dwBytesReturned, NULL, NULL) == SOCKET_ERROR) {
PCP_LOG(PCP_LOGLVL_PERR, ("WSAIoctl failed"));
PCP_LOG(PCP_LOGLVL_PERR, "WSAIoctl failed");
return 1;
}
+1 -1
View File
@@ -80,7 +80,7 @@ void pcp_logger(pcp_loglvl_e log_level, const char *fmt, ...)
#define PCP_LOG(level, fmt, ...) \
{ \
if (level <= PCP_MAX_LOG_LEVEL) \
pcp_logger(level, fmt, __VA_ARGS__); \
pcp_logger(level, fmt, ##__VA_ARGS__); \
}
#define PCP_LOG_END(level)
@@ -26,6 +26,12 @@
#ifndef PCP_GETTIMEOFDAY
#define PCP_GETTIMEOFDAY
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif /*PCP_GETTIMEOFDAY*/
@@ -81,7 +81,7 @@ static inline const char *pcp_inet_ntop(int af, const void *src, char *dst,
#define getpid GetCurrentProcessId
int gettimeofday(struct timeval *tv, struct timezone *tz);
#include "pcp_gettimeofday.h"
#define MSG_DONTWAIT 0x0
+2 -2
View File
@@ -21,8 +21,8 @@
#include <fcntl.h>
#ifdef _WIN32
#include <Winsock2.h>
#include <Ws2tcpip.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#define strncasecmp _strnicmp
#else
#include <unistd.h>