Make the sim buildable with mingw again
authorgevaerts <gevaerts@a1c6a512-1295-4272-9138-f99709370657>
Fri, 14 May 2010 22:57:52 +0000 (14 22:57 +0000)
committergevaerts <gevaerts@a1c6a512-1295-4272-9138-f99709370657>
Fri, 14 May 2010 22:57:52 +0000 (14 22:57 +0000)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26037 a1c6a512-1295-4272-9138-f99709370657

apps/plugin.c
apps/plugin.h
apps/plugins/frotz/frotzplugin.h
apps/plugins/lua/rockaux.c
firmware/SOURCES
firmware/include/string-extra.h
firmware/include/strtok_r.h [copied from firmware/include/string-extra.h with 85% similarity]

index 1ab15f8..b60e2d6 100644 (file)
@@ -598,7 +598,7 @@ static const struct plugin_api rockbox_api = {
 #endif
 
     /* misc */
-#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
+#if !defined(SIMULATOR)
     &errno,
 #endif
     srand,
index 584c146..5aaa638 100644 (file)
@@ -737,7 +737,7 @@ struct plugin_api {
 #endif
 
     /* misc */
-#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
+#if !defined(SIMULATOR)
     int* __errno;
 #endif
     void (*srand)(unsigned int seed);
index 1a52bdb..f975fc8 100644 (file)
@@ -27,6 +27,7 @@
  * pretend stdio.h is implemented. references to FILE * still have to be
  * changed to int, and references to NULL into -1, but there are less of those
  */
+#undef ferror
 #define fread(ptr, size, nmemb, stream) rb->read(stream, ptr, size*nmemb)
 #define fwrite(ptr, size, nmemb, stream) rb->write(stream, ptr, size*nmemb)
 #define fclose(stream) rb->close(stream)
index ea95f23..1f832d4 100644 (file)
@@ -24,7 +24,7 @@
 #define _ROCKCONF_H_ /* Protect against unwanted include */
 #include "lua.h"
 
-#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
+#if !defined(SIMULATOR)
 int errno = 0;
 #endif
 
index 16dc9ca..68074db 100644 (file)
@@ -24,6 +24,7 @@ debug.c
 /* Standard library */
 #if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
 libc/errno.c
+libc/strtok.c
 /* alsa on linux requires a more advanced sprintf, i.e. not ours */
 libc/sprintf.c
 #endif /* !SIMULATOR || __MINGW32__ || __CYGWIN__ */
@@ -40,7 +41,6 @@ libc/strcmp.c
 libc/strcpy.c
 libc/strncmp.c
 libc/strrchr.c
-libc/strtok.c
 libc/strstr.c
 libc/mktime.c
 #endif /* !defined(SIMULATOR)*/
index 5fe5ab8..16dd2fd 100644 (file)
@@ -25,3 +25,4 @@
 #include "strlcat.h"
 #include "strcasecmp.h"
 #include "strcasestr.h"
+#include "strtok_r.h"
similarity index 85%
copy from firmware/include/string-extra.h
copy to firmware/include/strtok_r.h
index 5fe5ab8..f472763 100644 (file)
@@ -20,8 +20,9 @@
  ****************************************************************************/
 
 
-#include <string.h>
-#include "strlcpy.h"
-#include "strlcat.h"
-#include "strcasecmp.h"
-#include "strcasestr.h"
+#ifndef __STRTOK_R_H__
+#define __STRTOK_R_H__
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+char    *strtok_r(char *, const char *, char **);
+#endif
+#endif