sdl: Fixes for the SDL apps, so they support building simulator on Windows
Change-Id: I277d391482a80e5bf9dd8049cd3b78c5cae7205e
diff --git a/apps/plugins/sdl/include/SDL_config_rockbox.h b/apps/plugins/sdl/include/SDL_config_rockbox.h
index 2cefc24..bee63c4 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 3bc6504..9e5330c 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 fe17207..72dac7f 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 @@
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 ab7d6eb..a9a0000 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 13ec77c..af74a53 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 2648d1f..400d672 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"