mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
123 lines
4.3 KiB
Diff
123 lines
4.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Gunnar Beutner <gbeutner@serenityos.org>
|
|
Date: Tue, 5 Apr 2022 23:05:14 +0200
|
|
Subject: [PATCH] All sorts of fixes for the build
|
|
|
|
Co-Authored-By: Kevin Nobel <kevin@2sk.nl>
|
|
---
|
|
cmake/CompileFlags.cmake | 2 +-
|
|
src/network/core/host.cpp | 2 ++
|
|
src/network/core/os_abstraction.h | 3 ++-
|
|
src/os/unix/unix.cpp | 4 +++-
|
|
src/stdafx.h | 6 +++---
|
|
5 files changed, 11 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake
|
|
index ad4a46a..50df38e 100644
|
|
--- a/cmake/CompileFlags.cmake
|
|
+++ b/cmake/CompileFlags.cmake
|
|
@@ -163,7 +163,7 @@ macro(compile_flags)
|
|
message(FATAL_ERROR "No warning flags are set for this compiler yet; please consider creating a Pull Request to add support for this compiler.")
|
|
endif()
|
|
|
|
- if(NOT WIN32 AND NOT HAIKU)
|
|
+ if(NOT WIN32 AND NOT HAIKU AND NOT SERENITYOS)
|
|
# rdynamic is used to get useful stack traces from crash reports.
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
|
|
endif()
|
|
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
|
|
index b55f5f5..0ae76d3 100644
|
|
--- a/src/network/core/host.cpp
|
|
+++ b/src/network/core/host.cpp
|
|
@@ -82,6 +82,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // Wi
|
|
|
|
static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // !GETIFADDRS implementation
|
|
{
|
|
+#ifndef __serenity__
|
|
SOCKET sock = socket(AF_INET, SOCK_DGRAM, 0);
|
|
if (sock == INVALID_SOCKET) return;
|
|
|
|
@@ -118,6 +119,7 @@ static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // !G
|
|
}
|
|
|
|
closesocket(sock);
|
|
+#endif
|
|
}
|
|
#endif /* all NetworkFindBroadcastIPsInternals */
|
|
|
|
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
|
|
index 6bb6101..100678a 100644
|
|
--- a/src/network/core/os_abstraction.h
|
|
+++ b/src/network/core/os_abstraction.h
|
|
@@ -74,13 +74,14 @@ typedef unsigned long in_addr_t;
|
|
# include <unistd.h>
|
|
# include <sys/ioctl.h>
|
|
# include <sys/socket.h>
|
|
+# include <sys/select.h>
|
|
# include <netinet/in.h>
|
|
# include <netinet/tcp.h>
|
|
# include <arpa/inet.h>
|
|
# include <net/if.h>
|
|
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
|
|
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__INNOTEK_LIBC__) \
|
|
- && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
|
|
+ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) && !defined(__serenity__)
|
|
/* If for any reason ifaddrs.h does not exist on your system, comment out
|
|
* the following two lines and an alternative way will be used to fetch
|
|
* the list of IPs from the system. */
|
|
diff --git a/src/os/unix/unix.cpp b/src/os/unix/unix.cpp
|
|
index 95d6fa1..3c7b567 100644
|
|
--- a/src/os/unix/unix.cpp
|
|
+++ b/src/os/unix/unix.cpp
|
|
@@ -42,9 +42,11 @@
|
|
# define HAS_SYSCTL
|
|
#endif
|
|
|
|
+#ifndef __serenity__
|
|
#ifdef HAS_STATVFS
|
|
#include <sys/statvfs.h>
|
|
#endif
|
|
+#endif
|
|
|
|
#ifdef HAS_SYSCTL
|
|
#include <sys/sysctl.h>
|
|
@@ -84,7 +86,7 @@ bool FiosGetDiskFreeSpace(const char *path, uint64 *tot)
|
|
|
|
if (statfs(path, &s) != 0) return false;
|
|
free = (uint64)s.f_bsize * s.f_bavail;
|
|
-#elif defined(HAS_STATVFS)
|
|
+#elif defined(HAS_STATVFS) && !defined(__serenity__)
|
|
struct statvfs s;
|
|
|
|
if (statvfs(path, &s) != 0) return false;
|
|
diff --git a/src/stdafx.h b/src/stdafx.h
|
|
index effd57c..98800f9 100644
|
|
--- a/src/stdafx.h
|
|
+++ b/src/stdafx.h
|
|
@@ -38,7 +38,7 @@
|
|
# define TROUBLED_INTS
|
|
#endif
|
|
|
|
-#if defined(__HAIKU__) || defined(__CYGWIN__)
|
|
+#if defined(__HAIKU__) || defined(__CYGWIN__) || defined(__serenity__)
|
|
# include <strings.h> /* strncasecmp */
|
|
#endif
|
|
|
|
@@ -118,7 +118,7 @@
|
|
# define strcasecmp stricmp
|
|
#endif
|
|
|
|
-#if defined(SUNOS) || defined(HPUX) || defined(__CYGWIN__)
|
|
+#if defined(SUNOS) || defined(HPUX) || defined(__CYGWIN__) || defined(__serenity__)
|
|
# include <alloca.h>
|
|
#endif
|
|
|
|
@@ -318,7 +318,7 @@
|
|
typedef unsigned char byte;
|
|
|
|
/* This is already defined in unix, but not in QNX Neutrino (6.x) or Cygwin. */
|
|
-#if (!defined(UNIX) && !defined(__HAIKU__)) || defined(__QNXNTO__) || defined(__CYGWIN__)
|
|
+#if (!defined(UNIX) && !defined(__HAIKU__)) || defined(__QNXNTO__) || defined(__CYGWIN__) || defined(__serenity__)
|
|
typedef unsigned int uint;
|
|
#endif
|
|
|