ports/xash-fwgs: Cleanup patches
Remove patches that are no longer needed and cleanup the general support patch
This commit is contained in:
parent
a83fa6f4c6
commit
1d07151743
|
|
@ -1,17 +1,17 @@
|
||||||
From 2b3a0198640c23a7f8f8247ed1edae309c11e15f Mon Sep 17 00:00:00 2001
|
From 49d1ca61e6249c3bc3284a6b55578b4ddd7b13ac Mon Sep 17 00:00:00 2001
|
||||||
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
||||||
Date: Thu, 31 Jul 2025 22:15:43 +0300
|
Date: Tue, 13 Jan 2026 20:49:19 +0200
|
||||||
Subject: [PATCH 1/2] add support for banan-os
|
Subject: [PATCH] add support for banan-os
|
||||||
|
|
||||||
---
|
---
|
||||||
engine/common/net_http.c | 4 +++-
|
engine/common/net_http.c | 4 +++-
|
||||||
engine/common/net_ws.c | 17 +++++++++++++++++
|
engine/common/net_ws.c | 6 ++++++
|
||||||
engine/common/whereami.c | 16 ++++++++++++++++
|
engine/common/whereami.c | 2 +-
|
||||||
engine/platform/posix/lib_posix.c | 2 ++
|
engine/platform/posix/net.h | 4 ++++
|
||||||
public/build.c | 2 ++
|
public/build.c | 2 ++
|
||||||
public/build.h | 3 +++
|
public/build.h | 3 +++
|
||||||
public/buildenums.h | 3 +++
|
public/buildenums.h | 3 +++
|
||||||
7 files changed, 46 insertions(+), 1 deletion(-)
|
7 files changed, 22 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/engine/common/net_http.c b/engine/common/net_http.c
|
diff --git a/engine/common/net_http.c b/engine/common/net_http.c
|
||||||
index ff6fd41b..ebb5bbad 100644
|
index ff6fd41b..ebb5bbad 100644
|
||||||
|
|
@ -36,23 +36,10 @@ index ff6fd41b..ebb5bbad 100644
|
||||||
res = fcntl( file->socket, F_GETFL, 0 );
|
res = fcntl( file->socket, F_GETFL, 0 );
|
||||||
|
|
||||||
diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c
|
diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c
|
||||||
index 7ee4cba0..e93a2410 100644
|
index 7ee4cba0..b44d5cf1 100644
|
||||||
--- a/engine/common/net_ws.c
|
--- a/engine/common/net_ws.c
|
||||||
+++ b/engine/common/net_ws.c
|
+++ b/engine/common/net_ws.c
|
||||||
@@ -1364,7 +1364,12 @@ static qboolean NET_QueuePacket( netsrc_t sock, netadr_t *from, byte *data, size
|
@@ -1617,7 +1617,11 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
||||||
byte buf[NET_MAX_FRAGMENT];
|
|
||||||
int ret, protocol;
|
|
||||||
int net_socket;
|
|
||||||
+#ifdef XASH_BANAN_OS
|
|
||||||
+ socklen_t addr_len;
|
|
||||||
+#else
|
|
||||||
WSAsize_t addr_len;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
struct sockaddr_storage addr = { 0 };
|
|
||||||
|
|
||||||
*length = 0;
|
|
||||||
@@ -1617,7 +1622,11 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
|
||||||
if( family == AF_INET6 )
|
if( family == AF_INET6 )
|
||||||
pfamily = PF_INET6;
|
pfamily = PF_INET6;
|
||||||
|
|
||||||
|
|
@ -64,7 +51,7 @@ index 7ee4cba0..e93a2410 100644
|
||||||
{
|
{
|
||||||
err = WSAGetLastError();
|
err = WSAGetLastError();
|
||||||
if( err != WSAEAFNOSUPPORT )
|
if( err != WSAEAFNOSUPPORT )
|
||||||
@@ -1625,6 +1634,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
@@ -1625,6 +1629,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,7 +59,7 @@ index 7ee4cba0..e93a2410 100644
|
||||||
if( NET_IsSocketError( ioctlsocket( net_socket, FIONBIO, (void*)&_true )))
|
if( NET_IsSocketError( ioctlsocket( net_socket, FIONBIO, (void*)&_true )))
|
||||||
{
|
{
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -1634,6 +1644,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
@@ -1634,6 +1639,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
||||||
timeout.tv_sec = timeout.tv_usec = 0;
|
timeout.tv_sec = timeout.tv_usec = 0;
|
||||||
setsockopt( net_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
|
setsockopt( net_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
|
||||||
}
|
}
|
||||||
|
|
@ -80,81 +67,34 @@ index 7ee4cba0..e93a2410 100644
|
||||||
|
|
||||||
// make it broadcast capable
|
// make it broadcast capable
|
||||||
if( NET_IsSocketError( setsockopt( net_socket, SOL_SOCKET, SO_BROADCAST, (char *)&_true, sizeof( _true ))))
|
if( NET_IsSocketError( setsockopt( net_socket, SOL_SOCKET, SO_BROADCAST, (char *)&_true, sizeof( _true ))))
|
||||||
@@ -1686,6 +1697,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
|
||||||
optval = 0x10; // IPTOS_LOWDELAY
|
|
||||||
Con_Printf( "Enabling LOWDELAY TOS option\n" );
|
|
||||||
|
|
||||||
+#ifdef IP_TOS
|
|
||||||
if( NET_IsSocketError( setsockopt( net_socket, IPPROTO_IP, IP_TOS, (const char *)&optval, sizeof( optval ))))
|
|
||||||
{
|
|
||||||
err = WSAGetLastError();
|
|
||||||
@@ -1694,6 +1706,7 @@ static int NET_IPSocket( const char *net_iface, int port, int family )
|
|
||||||
closesocket( net_socket );
|
|
||||||
return INVALID_SOCKET;
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if( Sys_CheckParm( "-loopback" ))
|
|
||||||
@@ -1801,7 +1814,11 @@ static void NET_DetermineLocalAddress( void )
|
|
||||||
char hostname[512];
|
|
||||||
char buff[512];
|
|
||||||
struct sockaddr_storage address;
|
|
||||||
+#ifdef XASH_BANAN_OS
|
|
||||||
+ socklen_t namelen;
|
|
||||||
+#else
|
|
||||||
WSAsize_t namelen;
|
|
||||||
+#endif
|
|
||||||
const char *net_addr_string;
|
|
||||||
|
|
||||||
memset( &net_local, 0, sizeof( netadr_t ));
|
|
||||||
diff --git a/engine/common/whereami.c b/engine/common/whereami.c
|
diff --git a/engine/common/whereami.c b/engine/common/whereami.c
|
||||||
index 31726774..5b7ff504 100644
|
index 31726774..69a6cb9f 100644
|
||||||
--- a/engine/common/whereami.c
|
--- a/engine/common/whereami.c
|
||||||
+++ b/engine/common/whereami.c
|
+++ b/engine/common/whereami.c
|
||||||
@@ -851,6 +851,22 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
@@ -175,7 +175,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
||||||
return -1;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
+#elif defined(__banan_os__)
|
-#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__serenity__) || defined(WAI_USE_PROC_SELF_EXE)
|
||||||
+
|
+#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__serenity__) || defined(__banan_os__) || defined(WAI_USE_PROC_SELF_EXE)
|
||||||
+/* Not possible on this platform */
|
|
||||||
+
|
|
||||||
+WAI_FUNCSPEC
|
|
||||||
+int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length)
|
|
||||||
+{
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+WAI_FUNCSPEC
|
|
||||||
+int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|
||||||
+{
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#else
|
|
||||||
|
|
||||||
#error unsupported platform
|
#include <stdio.h>
|
||||||
diff --git a/engine/platform/posix/lib_posix.c b/engine/platform/posix/lib_posix.c
|
#include <stdlib.h>
|
||||||
index 23d1c3b1..a5a84fe1 100644
|
diff --git a/engine/platform/posix/net.h b/engine/platform/posix/net.h
|
||||||
--- a/engine/platform/posix/lib_posix.c
|
index 58532927..6ab3cd1f 100644
|
||||||
+++ b/engine/platform/posix/lib_posix.c
|
--- a/engine/platform/posix/net.h
|
||||||
@@ -208,6 +208,7 @@ const char *COM_NameForFunction( void *hInstance, void *function )
|
+++ b/engine/platform/posix/net.h
|
||||||
return Loader_GetFuncName_int(wm, function);
|
@@ -90,6 +90,10 @@ static int ioctl_stub( int d, unsigned long r, ... )
|
||||||
else
|
#define closesocket close
|
||||||
#endif
|
#endif
|
||||||
+#ifndef XASH_BANAN_OS
|
#define SOCKET int
|
||||||
// NOTE: dladdr() is a glibc extension
|
+#if XASH_BANAN_OS
|
||||||
{
|
+typedef socklen_t WSAsize_t;
|
||||||
Dl_info info = {0};
|
+#else
|
||||||
@@ -215,6 +216,7 @@ const char *COM_NameForFunction( void *hInstance, void *function )
|
typedef int WSAsize_t;
|
||||||
if( ret && info.dli_sname )
|
|
||||||
return COM_GetPlatformNeutralName( info.dli_sname );
|
|
||||||
}
|
|
||||||
+#endif
|
+#endif
|
||||||
#ifdef XASH_ALLOW_SAVERESTORE_OFFSETS
|
|
||||||
return COM_OffsetNameForFunction( function );
|
#endif // NET_H
|
||||||
#else
|
|
||||||
diff --git a/public/build.c b/public/build.c
|
diff --git a/public/build.c b/public/build.c
|
||||||
index 6c85bbaf..460b4040 100644
|
index 6c85bbaf..460b4040 100644
|
||||||
--- a/public/build.c
|
--- a/public/build.c
|
||||||
|
|
@ -211,5 +151,5 @@ index 4dc327d3..57585f73 100644
|
||||||
#error
|
#error
|
||||||
#endif
|
#endif
|
||||||
--
|
--
|
||||||
2.50.1
|
2.52.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
From b8c6ea53b4a8119f299fb6b5e4684c30795037a7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
|
||||||
Date: Thu, 31 Jul 2025 22:36:28 +0300
|
|
||||||
Subject: [PATCH] Don't export have libbacktrace
|
|
||||||
|
|
||||||
This doesnt work :)
|
|
||||||
---
|
|
||||||
3rdparty/libbacktrace/wscript | 1 -
|
|
||||||
1 file changed, 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/3rdparty/libbacktrace/wscript b/3rdparty/libbacktrace/wscript
|
|
||||||
index 2e076a56..98aca8d5 100644
|
|
||||||
--- a/3rdparty/libbacktrace/wscript
|
|
||||||
+++ b/3rdparty/libbacktrace/wscript
|
|
||||||
@@ -180,7 +180,6 @@ def build(bld):
|
|
||||||
features = 'frandomseed' if bld.env.HAVE_FRANDOM_SEED else '',
|
|
||||||
use = 'EXTRAFLAGS lzma z zstd',
|
|
||||||
includes = '. libbacktrace/',
|
|
||||||
- export_defines = 'HAVE_LIBBACKTRACE=1',
|
|
||||||
export_includes = 'libbacktrace/'
|
|
||||||
)
|
|
||||||
|
|
||||||
--
|
|
||||||
2.50.1
|
|
||||||
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
From 1e1fb9caff45f0cb05e89bfe452a7ff2abb558ff Mon Sep 17 00:00:00 2001
|
|
||||||
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
|
||||||
Date: Thu, 31 Jul 2025 22:17:48 +0300
|
|
||||||
Subject: [PATCH] include alloca on banan-os
|
|
||||||
|
|
||||||
This detection does not work :(
|
|
||||||
---
|
|
||||||
lib/os.h | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/lib/os.h b/lib/os.h
|
|
||||||
index 9ded7358..66b56704 100644
|
|
||||||
--- a/lib/os.h
|
|
||||||
+++ b/lib/os.h
|
|
||||||
@@ -62,7 +62,7 @@ void *_alloca(size_t size);
|
|
||||||
|
|
||||||
#endif /* _V_IFDEFJAIL_H_ */
|
|
||||||
|
|
||||||
-#ifdef HAVE_ALLOCA_H
|
|
||||||
+#if defined(HAVE_ALLOCA_H) || defined(__banan_os__)
|
|
||||||
# include <alloca.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
--
|
|
||||||
2.50.1
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue