|
| 1 | +diff -Naur openttd-1.11.0/cmake/CompileFlags.cmake openttd-1.11.0.serenity/cmake/CompileFlags.cmake |
| 2 | +--- openttd-1.11.0/cmake/CompileFlags.cmake 2021-04-01 14:33:44.000000000 +0200 |
| 3 | ++++ openttd-1.11.0.serenity/cmake/CompileFlags.cmake 2021-04-19 19:30:33.457232215 +0200 |
| 4 | +@@ -154,7 +154,7 @@ |
| 5 | + message(FATAL_ERROR "No warning flags are set for this compiler yet; please consider creating a Pull Request to add support for this compiler.") |
| 6 | + endif() |
| 7 | + |
| 8 | +- if(NOT WIN32) |
| 9 | ++ if(NOT WIN32 AND NOT SERENITYOS) |
| 10 | + # rdynamic is used to get useful stack traces from crash reports. |
| 11 | + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") |
| 12 | + endif() |
| 13 | +diff -Naur openttd-1.11.0/src/network/core/address.cpp openttd-1.11.0.serenity/src/network/core/address.cpp |
| 14 | +--- openttd-1.11.0/src/network/core/address.cpp 2021-04-01 14:33:44.000000000 +0200 |
| 15 | ++++ openttd-1.11.0.serenity/src/network/core/address.cpp 2021-04-19 19:30:33.457232215 +0200 |
| 16 | +@@ -372,7 +372,7 @@ |
| 17 | + DEBUG(net, 3, "[%s] could not set reusable %s sockets for port %s: %s", type, family, address, strerror(errno)); |
| 18 | + } |
| 19 | + |
| 20 | +-#ifndef __OS2__ |
| 21 | ++#if !defined(__OS2__) && !defined(__serenity__) |
| 22 | + if (runp->ai_family == AF_INET6 && |
| 23 | + setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&on, sizeof(on)) == -1) { |
| 24 | + DEBUG(net, 3, "[%s] could not disable IPv4 over IPv6 on port %s: %s", type, address, strerror(errno)); |
| 25 | +diff -Naur openttd-1.11.0/src/network/core/host.cpp openttd-1.11.0.serenity/src/network/core/host.cpp |
| 26 | +--- openttd-1.11.0/src/network/core/host.cpp 2021-04-01 14:33:44.000000000 +0200 |
| 27 | ++++ openttd-1.11.0.serenity/src/network/core/host.cpp 2021-04-19 19:30:33.457232215 +0200 |
| 28 | +@@ -147,6 +147,7 @@ |
| 29 | + |
| 30 | + static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // !GETIFADDRS implementation |
| 31 | + { |
| 32 | ++#ifndef __serenity__ |
| 33 | + SOCKET sock = socket(AF_INET, SOCK_DGRAM, 0); |
| 34 | + if (sock == INVALID_SOCKET) return; |
| 35 | + |
| 36 | +@@ -183,6 +184,7 @@ |
| 37 | + } |
| 38 | + |
| 39 | + closesocket(sock); |
| 40 | ++#endif |
| 41 | + } |
| 42 | + #endif /* all NetworkFindBroadcastIPsInternals */ |
| 43 | + |
| 44 | +diff -Naur openttd-1.11.0/src/network/core/os_abstraction.h openttd-1.11.0.serenity/src/network/core/os_abstraction.h |
| 45 | +--- openttd-1.11.0/src/network/core/os_abstraction.h 2021-04-01 14:33:44.000000000 +0200 |
| 46 | ++++ openttd-1.11.0.serenity/src/network/core/os_abstraction.h 2021-04-19 19:30:33.457232215 +0200 |
| 47 | +@@ -59,13 +59,14 @@ |
| 48 | + # include <unistd.h> |
| 49 | + # include <sys/ioctl.h> |
| 50 | + # include <sys/socket.h> |
| 51 | ++# include <sys/select.h> |
| 52 | + # include <netinet/in.h> |
| 53 | + # include <netinet/tcp.h> |
| 54 | + # include <arpa/inet.h> |
| 55 | + # include <net/if.h> |
| 56 | + /* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */ |
| 57 | + # if !defined(__sgi__) && !defined(SUNOS) && !defined(__INNOTEK_LIBC__) \ |
| 58 | +- && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) |
| 59 | ++ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) && !defined(__serenity__) |
| 60 | + /* If for any reason ifaddrs.h does not exist on your system, comment out |
| 61 | + * the following two lines and an alternative way will be used to fetch |
| 62 | + * the list of IPs from the system. */ |
| 63 | +diff -Naur openttd-1.11.0/src/os/unix/unix.cpp openttd-1.11.0.serenity/src/os/unix/unix.cpp |
| 64 | +--- openttd-1.11.0/src/os/unix/unix.cpp 2021-04-01 14:33:44.000000000 +0200 |
| 65 | ++++ openttd-1.11.0.serenity/src/os/unix/unix.cpp 2021-04-19 19:30:33.457232215 +0200 |
| 66 | +@@ -42,9 +42,11 @@ |
| 67 | + # define HAS_SYSCTL |
| 68 | + #endif |
| 69 | + |
| 70 | ++#ifndef __serenity__ |
| 71 | + #ifdef HAS_STATVFS |
| 72 | + #include <sys/statvfs.h> |
| 73 | + #endif |
| 74 | ++#endif |
| 75 | + |
| 76 | + #ifdef HAS_SYSCTL |
| 77 | + #include <sys/sysctl.h> |
| 78 | +@@ -84,7 +86,7 @@ |
| 79 | + |
| 80 | + if (statfs(path, &s) != 0) return false; |
| 81 | + free = (uint64)s.f_bsize * s.f_bavail; |
| 82 | +-#elif defined(HAS_STATVFS) |
| 83 | ++#elif defined(HAS_STATVFS) && !defined(__serenity__) |
| 84 | + struct statvfs s; |
| 85 | + |
| 86 | + if (statvfs(path, &s) != 0) return false; |
| 87 | +diff -Naur openttd-1.11.0/src/stdafx.h openttd-1.11.0.serenity/src/stdafx.h |
| 88 | +--- openttd-1.11.0/src/stdafx.h 2021-04-01 14:33:44.000000000 +0200 |
| 89 | ++++ openttd-1.11.0.serenity/src/stdafx.h 2021-04-19 20:08:30.758187723 +0200 |
| 90 | +@@ -28,7 +28,7 @@ |
| 91 | + # define TROUBLED_INTS |
| 92 | + #endif |
| 93 | + |
| 94 | +-#if defined(__HAIKU__) || defined(__CYGWIN__) |
| 95 | ++#if defined(__HAIKU__) || defined(__CYGWIN__) || defined(__serenity__) |
| 96 | + # include <strings.h> /* strncasecmp */ |
| 97 | + #endif |
| 98 | + |
| 99 | +@@ -107,7 +107,7 @@ |
| 100 | + # define strcasecmp stricmp |
| 101 | + #endif |
| 102 | + |
| 103 | +-#if defined(SUNOS) || defined(HPUX) || defined(__CYGWIN__) |
| 104 | ++#if defined(SUNOS) || defined(HPUX) || defined(__CYGWIN__) || defined(__serenity__) |
| 105 | + # include <alloca.h> |
| 106 | + #endif |
| 107 | + |
| 108 | +@@ -307,7 +307,7 @@ |
| 109 | + typedef unsigned char byte; |
| 110 | + |
| 111 | + /* This is already defined in unix, but not in QNX Neutrino (6.x) or Cygwin. */ |
| 112 | +-#if (!defined(UNIX) && !defined(__HAIKU__)) || defined(__QNXNTO__) || defined(__CYGWIN__) |
| 113 | ++#if (!defined(UNIX) && !defined(__HAIKU__)) || defined(__QNXNTO__) || defined(__CYGWIN__) || defined(__serenity__) |
| 114 | + typedef unsigned int uint; |
| 115 | + #endif |
| 116 | + |
0 commit comments