1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-09-19 09:51:28 +03:00

Fix -Wincompatible-pointer-types in Win32GetDnsSuffix

Explicitly cast the `IP_ADAPTER_ADDRESSES_XP *` pointer to `PIP_ADAPTER_ADDRESSES` when calling `GetAdaptersAddresses` in `src/Mayaqua/Network.c`.

This resolves build errors with modern Windows SDKs (e.g., 10.0.26100.0) where `PIP_ADAPTER_ADDRESSES` resolves to `IP_ADAPTER_ADDRESSES_LH *`, which compilers like Clang flag as an incompatible pointer type.
This commit is contained in:
Ilia Shipitsin
2026-08-23 12:07:56 +02:00
parent 84069c1238
commit 9681053dc0
+2 -2
View File
@@ -9265,12 +9265,12 @@ bool Win32GetDnsSuffix(char *domain, UINT size)
info_size = 0; info_size = 0;
info = ZeroMalloc(sizeof(IP_ADAPTER_ADDRESSES_XP)); info = ZeroMalloc(sizeof(IP_ADAPTER_ADDRESSES_XP));
if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) == ERROR_BUFFER_OVERFLOW) if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) == ERROR_BUFFER_OVERFLOW)
{ {
Free(info); Free(info);
info = ZeroMalloc(info_size); info = ZeroMalloc(info_size);
} }
if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) != NO_ERROR) if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) != NO_ERROR)
{ {
Free(info); Free(info);
return false; return false;