Make the sim buildable with mingw again

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26037 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2010-05-14 22:57:52 +00:00
parent 759cfece4b
commit 530c25130f
7 changed files with 34 additions and 4 deletions

View 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,

View 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);

View 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)

View 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

View 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)*/

View File

@ -25,3 +25,4 @@
#include "strlcat.h"
#include "strcasecmp.h"
#include "strcasestr.h"
#include "strtok_r.h"

View File

@ -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