summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVencislav Atanasov <user890104@freemyipod.org>2019-07-28 21:02:11 +0300
committerFranklin Wei <franklin@rockbox.org>2019-07-31 19:34:18 +0200
commit722ddcf6ba35b5b06ae42b399140056ca67ad7ed (patch)
treebebce86e0049d51239b534d228a3fef4a1292a67
parent349e111c81abd2214859f1afc4b2e96fb3a90733 (diff)
downloadrockbox-722ddcf.tar.gz
rockbox-722ddcf.tar.bz2
rockbox-722ddcf.zip
sdl: Fixes for the SDL apps, so they support building simulator on Windows
Change-Id: I277d391482a80e5bf9dd8049cd3b78c5cae7205e
-rw-r--r--apps/plugins/sdl/include/SDL_config_rockbox.h4
-rw-r--r--apps/plugins/sdl/include/SDL_platform.h1
-rw-r--r--apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h1
-rw-r--r--apps/plugins/sdl/progs/duke3d/Game/src/global.h5
-rw-r--r--apps/plugins/sdl/progs/wolf3d/wl_def.h2
-rw-r--r--apps/plugins/sdl/src/video/SDL_video.c2
6 files changed, 15 insertions, 0 deletions
diff --git a/apps/plugins/sdl/include/SDL_config_rockbox.h b/apps/plugins/sdl/include/SDL_config_rockbox.h
index 2cefc244e2..bee63c4f20 100644
--- a/apps/plugins/sdl/include/SDL_config_rockbox.h
+++ b/apps/plugins/sdl/include/SDL_config_rockbox.h
@@ -30,6 +30,10 @@
#include "plugin.h"
#include "lib/pluginlib_exit.h"
+#ifdef _WIN32
+#define __int64 long long
+#endif
+
#include <setjmp.h>
#include <stdarg.h>
#include <stdint.h>
diff --git a/apps/plugins/sdl/include/SDL_platform.h b/apps/plugins/sdl/include/SDL_platform.h
index 3bc6504232..9e5330c54b 100644
--- a/apps/plugins/sdl/include/SDL_platform.h
+++ b/apps/plugins/sdl/include/SDL_platform.h
@@ -30,6 +30,7 @@
#if defined(ROCKBOX)
#undef __ROCKBOX__
#undef __LINUX__ /* maybe sim */
+#undef __WIN32__ /* maybe sim */
#define __ROCKBOX__ 1
#else
#error This SDL supports Rockbox only!
diff --git a/apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h b/apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h
index fe172072b5..72dac7ff65 100644
--- a/apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h
+++ b/apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h
@@ -42,6 +42,7 @@ void setGameDir(char* gameDir);
int32_t TCkopen4load(const char *filename, int32_t readfromGRP);
+#define filelength rb_filelength
int32_t filelength(int32_t fd);
#endif
diff --git a/apps/plugins/sdl/progs/duke3d/Game/src/global.h b/apps/plugins/sdl/progs/duke3d/Game/src/global.h
index ab7d6eb634..a9a00002f0 100644
--- a/apps/plugins/sdl/progs/duke3d/Game/src/global.h
+++ b/apps/plugins/sdl/progs/duke3d/Game/src/global.h
@@ -12,6 +12,11 @@
#include "SDL.h"
#define open rb->open
+#define strlwr duke_strlwr
+#define strupr duke_strupr
+#define itoa duke_itoa
+#define ltoa duke_ltoa
+#define ultoa duke_ultoa
void FixFilePath(char *filename);
int FindDistance3D(int ix, int iy, int iz);
diff --git a/apps/plugins/sdl/progs/wolf3d/wl_def.h b/apps/plugins/sdl/progs/wolf3d/wl_def.h
index 13ec77cf70..af74a5315c 100644
--- a/apps/plugins/sdl/progs/wolf3d/wl_def.h
+++ b/apps/plugins/sdl/progs/wolf3d/wl_def.h
@@ -17,6 +17,8 @@
#define read(a, b, c) rb->read((a), (b), (c))
#define write(a, b, c) rb->write((a), (b), (c))
#define close(a) rb->close(a)
+#define itoa wolf3d_itoa
+#define ltoa wolf3d_ltoa
#if !defined O_BINARY
# define O_BINARY 0
diff --git a/apps/plugins/sdl/src/video/SDL_video.c b/apps/plugins/sdl/src/video/SDL_video.c
index 2648d1fb3c..400d672e18 100644
--- a/apps/plugins/sdl/src/video/SDL_video.c
+++ b/apps/plugins/sdl/src/video/SDL_video.c
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#undef WIN32
+
/* The high-level video driver subsystem */
#include "SDL.h"