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 = { #endif /* misc */ -#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) +#if !defined(SIMULATOR) &errno, #endif 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 { #endif /* misc */ -#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) +#if !defined(SIMULATOR) int* __errno; #endif 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 @@ * 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) 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 @@ #define _ROCKCONF_H_ /* Protect against unwanted include */ #include "lua.h" -#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) +#if !defined(SIMULATOR) int errno = 0; #endif diff --git a/firmware/SOURCES b/firmware/SOURCES index 16dc9ca608..68074dbbec 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -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)*/ 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 @@ #include "strlcat.h" #include "strcasecmp.h" #include "strcasestr.h" +#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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 Thomas Martitz + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + +#ifndef __STRTOK_R_H__ +#define __STRTOK_R_H__ +#if defined(__MINGW32__) || defined(__CYGWIN__) +char *strtok_r(char *, const char *, char **); +#endif +#endif