summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-05-14 22:57:52 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-05-14 22:57:52 +0000
commit530c25130fb561a1260d32b756d008385d7e5a69 (patch)
tree318db0e5294d9baceeff060df29f2ac47626ffb4
parent759cfece4bb96547f34bf52ceffd0412599d6362 (diff)
downloadrockbox-530c25130fb561a1260d32b756d008385d7e5a69.tar.gz
rockbox-530c25130fb561a1260d32b756d008385d7e5a69.zip
Make the sim buildable with mingw again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26037 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h2
-rw-r--r--apps/plugins/frotz/frotzplugin.h1
-rw-r--r--apps/plugins/lua/rockaux.c2
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/include/string-extra.h1
-rw-r--r--firmware/include/strtok_r.h28
7 files changed, 34 insertions, 4 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 1ab15f82f2..b60e2d6768 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -598,7 +598,7 @@ static const struct plugin_api rockbox_api = {
598#endif 598#endif
599 599
600 /* misc */ 600 /* misc */
601#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) 601#if !defined(SIMULATOR)
602 &errno, 602 &errno,
603#endif 603#endif
604 srand, 604 srand,
diff --git a/apps/plugin.h b/apps/plugin.h
index 584c146b94..5aaa6380b7 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -737,7 +737,7 @@ struct plugin_api {
737#endif 737#endif
738 738
739 /* misc */ 739 /* misc */
740#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) 740#if !defined(SIMULATOR)
741 int* __errno; 741 int* __errno;
742#endif 742#endif
743 void (*srand)(unsigned int seed); 743 void (*srand)(unsigned int seed);
diff --git a/apps/plugins/frotz/frotzplugin.h b/apps/plugins/frotz/frotzplugin.h
index 1a52bdb913..f975fc8c22 100644
--- a/apps/plugins/frotz/frotzplugin.h
+++ b/apps/plugins/frotz/frotzplugin.h
@@ -27,6 +27,7 @@
27 * pretend stdio.h is implemented. references to FILE * still have to be 27 * pretend stdio.h is implemented. references to FILE * still have to be
28 * changed to int, and references to NULL into -1, but there are less of those 28 * changed to int, and references to NULL into -1, but there are less of those
29 */ 29 */
30#undef ferror
30#define fread(ptr, size, nmemb, stream) rb->read(stream, ptr, size*nmemb) 31#define fread(ptr, size, nmemb, stream) rb->read(stream, ptr, size*nmemb)
31#define fwrite(ptr, size, nmemb, stream) rb->write(stream, ptr, size*nmemb) 32#define fwrite(ptr, size, nmemb, stream) rb->write(stream, ptr, size*nmemb)
32#define fclose(stream) rb->close(stream) 33#define fclose(stream) rb->close(stream)
diff --git a/apps/plugins/lua/rockaux.c b/apps/plugins/lua/rockaux.c
index ea95f232ab..1f832d4cc7 100644
--- a/apps/plugins/lua/rockaux.c
+++ b/apps/plugins/lua/rockaux.c
@@ -24,7 +24,7 @@
24#define _ROCKCONF_H_ /* Protect against unwanted include */ 24#define _ROCKCONF_H_ /* Protect against unwanted include */
25#include "lua.h" 25#include "lua.h"
26 26
27#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) 27#if !defined(SIMULATOR)
28int errno = 0; 28int errno = 0;
29#endif 29#endif
30 30
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 16dc9ca608..68074dbbec 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -24,6 +24,7 @@ debug.c
24/* Standard library */ 24/* Standard library */
25#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) 25#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
26libc/errno.c 26libc/errno.c
27libc/strtok.c
27/* alsa on linux requires a more advanced sprintf, i.e. not ours */ 28/* alsa on linux requires a more advanced sprintf, i.e. not ours */
28libc/sprintf.c 29libc/sprintf.c
29#endif /* !SIMULATOR || __MINGW32__ || __CYGWIN__ */ 30#endif /* !SIMULATOR || __MINGW32__ || __CYGWIN__ */
@@ -40,7 +41,6 @@ libc/strcmp.c
40libc/strcpy.c 41libc/strcpy.c
41libc/strncmp.c 42libc/strncmp.c
42libc/strrchr.c 43libc/strrchr.c
43libc/strtok.c
44libc/strstr.c 44libc/strstr.c
45libc/mktime.c 45libc/mktime.c
46#endif /* !defined(SIMULATOR)*/ 46#endif /* !defined(SIMULATOR)*/
diff --git a/firmware/include/string-extra.h b/firmware/include/string-extra.h
index 5fe5ab8119..16dd2fdccf 100644
--- a/firmware/include/string-extra.h
+++ b/firmware/include/string-extra.h
@@ -25,3 +25,4 @@
25#include "strlcat.h" 25#include "strlcat.h"
26#include "strcasecmp.h" 26#include "strcasecmp.h"
27#include "strcasestr.h" 27#include "strcasestr.h"
28#include "strtok_r.h"
diff --git a/firmware/include/strtok_r.h b/firmware/include/strtok_r.h
new file mode 100644
index 0000000000..f4727630fa
--- /dev/null
+++ b/firmware/include/strtok_r.h
@@ -0,0 +1,28 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Thomas Martitz
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#ifndef __STRTOK_R_H__
24#define __STRTOK_R_H__
25#if defined(__MINGW32__) || defined(__CYGWIN__)
26char *strtok_r(char *, const char *, char **);
27#endif
28#endif