LibCore: Do not include SocketAddressWindows.h in System.h

SocketAddressWindows.h contains (re)definitions of a bunch of system-
level types. This leads to a bunch of conflicts when trying to include
proper Windows headers in SystemWindows.cpp. This patch removes this
inclusion and just forward-declares the couple of types we need.
This commit is contained in:
Timothy Flynn 2025-11-30 10:21:31 -05:00 committed by Tim Flynn
parent 2d22ef0db5
commit 5c88c3718b
Notes: github-actions[bot] 2025-12-01 11:35:42 +00:00
4 changed files with 9 additions and 1 deletions

View file

@ -32,15 +32,20 @@
# include <termios.h>
# include <utime.h>
#else
# include "SocketAddressWindows.h"
# include <io.h>
# define O_CLOEXEC O_NOINHERIT
# define STDIN_FILENO _get_osfhandle(_fileno(stdin))
# define STDOUT_FILENO _get_osfhandle(_fileno(stdout))
# define STDERR_FILENO _get_osfhandle(_fileno(stderr))
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
using sighandler_t = void (*)(int);
using socklen_t = int;
struct addrinfo;
struct sockaddr;
#endif
#if !defined(AK_OS_BSD_GENERIC) && !defined(AK_OS_ANDROID) && !defined(AK_OS_WINDOWS)

View file

@ -13,6 +13,7 @@
#include <AK/ByteString.h>
#include <AK/ScopeGuard.h>
#include <LibCore/Process.h>
#include <LibCore/SocketAddress.h>
#include <LibCore/System.h>
#include <direct.h>
#include <sys/mman.h>

View file

@ -11,6 +11,7 @@
#include <LibCore/Event.h>
#include <LibCore/EventReceiver.h>
#include <LibCore/Notifier.h>
#include <LibCore/SocketAddress.h>
#include <LibCore/System.h>
#include <LibCore/ThreadEventQueue.h>
#include <LibThreading/Mutex.h>

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/SocketAddress.h>
#include <LibCore/System.h>
#include <RequestServer/RequestPipe.h>