redox/recipes/openttd/01_redox.patch
2019-01-07 17:36:36 -07:00

65 lines
2.1 KiB
Diff

diff -ruwN source/config.lib source-new/config.lib
--- source/config.lib 2018-12-29 07:28:58.975290421 -0700
+++ source-new/config.lib 2019-01-06 17:30:43.830146522 -0700
@@ -1486,7 +1486,7 @@
# Special CXXFlags for HOST
CXXFLAGS="$CXXFLAGS"
# Libs to compile. In fact this is just LDFLAGS
- LIBS="-lstdc++"
+ LIBS="-lstdc++ -lSDL -lorbital"
# LDFLAGS used for HOST
LDFLAGS="$LDFLAGS"
# FEATURES for HOST (lto)
diff -ruwN source/src/music/extmidi.cpp source-new/src/music/extmidi.cpp
--- source/src/music/extmidi.cpp 2018-12-29 07:28:59.143295501 -0700
+++ source-new/src/music/extmidi.cpp 2018-12-29 10:14:06.637357598 -0700
@@ -115,7 +115,11 @@
switch (this->pid) {
case 0: {
close(0);
+#if defined(__redox__)
+ int d = open("null:", O_RDONLY);
+#else
int d = open("/dev/null", O_RDONLY);
+#endif
if (d != -1 && dup2(d, 1) != -1 && dup2(d, 2) != -1) {
execvp(this->params[0], this->params);
}
diff -ruwN source/src/rev.cpp.in source-new/src/rev.cpp.in
--- source/src/rev.cpp.in 2018-12-29 07:28:59.167296226 -0700
+++ source-new/src/rev.cpp.in 2018-12-29 10:11:42.314241804 -0700
@@ -57,7 +57,7 @@
* (compiling from sources without any version control software)
* and 2 is for modified revision.
*/
-const byte _openttd_revision_modified = !!MODIFIED!!;
+const byte _openttd_revision_modified = 2;
/**
* The NewGRF revision of OTTD:
diff -ruwN source/src/stdafx.h source-new/src/stdafx.h
--- source/src/stdafx.h 2018-12-29 07:28:59.203297314 -0700
+++ source-new/src/stdafx.h 2018-12-29 10:11:42.314241804 -0700
@@ -12,6 +12,9 @@
#ifndef STDAFX_H
#define STDAFX_H
+#include <strings.h>
+#include <alloca.h>
+
#if defined(__APPLE__)
#include "os/macosx/osx_stdafx.h"
#endif /* __APPLE__ */
diff -ruwN source/src/string.cpp source-new/src/string.cpp
--- source/src/string.cpp 2018-12-29 07:28:59.207297436 -0700
+++ source-new/src/string.cpp 2018-12-29 10:11:42.314241804 -0700
@@ -528,7 +528,7 @@
return length;
}
-#ifdef DEFINE_STRCASESTR
+#if 0
char *strcasestr(const char *haystack, const char *needle)
{
size_t hay_len = strlen(haystack);