From 954bf9e0505a7368c34047b311d613cff04393a1 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 3 Jun 2023 21:57:42 +0100 Subject: [PATCH] ntdll: Avoid using SOL_IPX to detect whether IPX is supported. 4.18+ Linux kernels remove support for IPX but keep SOL_IPX defined, which causes compilation errors as wine unconditionally uses IPX structures if this is the case. Instead check for IPX_MTU to determine IPX support as it is defined within the ipx.h header itself. --- dlls/ntdll/unix/socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index bc5bc84fdf8..80105eda0c9 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -45,6 +45,7 @@ #ifdef HAVE_NETIPX_IPX_H # include +# define HAS_IPX #elif defined(HAVE_LINUX_IPX_H) # ifdef HAVE_ASM_TYPES_H # include @@ -53,8 +54,6 @@ # include # endif # include -#endif -#if defined(SOL_IPX) || defined(SO_DEFAULT_HEADERS) # define HAS_IPX #endif @@ -2406,6 +2405,7 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc break; } +#ifdef HAS_IPX #ifdef SOL_IPX case IOCTL_AFD_WINE_GET_IPX_PTYPE: return do_getsockopt( handle, io, SOL_IPX, IPX_TYPE, out_buffer, out_size ); @@ -2444,6 +2444,7 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc return do_setsockopt( handle, io, 0, SO_DEFAULT_HEADERS, &value, sizeof(value) ); } #endif +#endif #ifdef HAS_IRDA #define MAX_IRDA_DEVICES 10