mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
Fix Cross Compilation (#7077)
* Fix a few libraries for functional cross compilation * include timeval
This commit is contained in:
1 parent
84d3cdf847
commit
2808606b84
7 files changed
+13
-7
No files matched your search
@@ -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)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include <winsock2.h>
|
||||
#include <ws2ipdef.h>
|
||||
|
||||
#include <Iphlpapi.h>
|
||||
#include <iphlpapi.h>
|
||||
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user