forked from len0rd/rockbox
Allow building simulators on systems where errno is thread-local by using the system's implementation of errno.h for simulator builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8871 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ef4e43822f
commit
b4ada860b3
5 changed files with 10 additions and 12 deletions
|
@ -1,11 +1,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
int errno;
|
|
||||||
|
|
||||||
int read_failure(FILE *fd) {
|
int read_failure(FILE *fd) {
|
||||||
fprintf(stderr, "Could not read from file: errno: %u ", errno);
|
fprintf(stderr, "Could not read from file: errno: %u ", errno);
|
||||||
if( feof(fd) ) fprintf(stderr, "EOF");
|
if( feof(fd) ) fprintf(stderr, "EOF");
|
||||||
|
|
|
@ -14,7 +14,9 @@ common/file.c
|
||||||
common/dircache.c
|
common/dircache.c
|
||||||
#endif
|
#endif
|
||||||
common/disk.c
|
common/disk.c
|
||||||
|
#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
|
||||||
common/errno.c
|
common/errno.c
|
||||||
|
#endif
|
||||||
common/memcmp.c
|
common/memcmp.c
|
||||||
common/memchr.c
|
common/memchr.c
|
||||||
common/qsort.c
|
common/qsort.c
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
/* errno is not a global variable, because that would make using it
|
/* errno is not a global variable, because that would make using it
|
||||||
non-reentrant. Instead, its address is returned by the function
|
non-reentrant. Instead, its address is returned by the function
|
||||||
__errno. */
|
__errno. */
|
||||||
|
|
||||||
|
#if defined(SIMULATOR) && !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||||
|
|
||||||
|
#include "/usr/include/errno.h" /* use the host system implementation */
|
||||||
|
|
||||||
|
#else /* use our own implementation */
|
||||||
|
|
||||||
#ifndef _SYS_ERRNO_H_
|
#ifndef _SYS_ERRNO_H_
|
||||||
|
|
||||||
|
@ -132,3 +138,4 @@ extern int errno;
|
||||||
#define __ELASTERROR 2000 /* Users can add values starting here */
|
#define __ELASTERROR 2000 /* Users can add values starting here */
|
||||||
|
|
||||||
#endif /* _SYS_ERRNO_H */
|
#endif /* _SYS_ERRNO_H */
|
||||||
|
#endif /* !SIMULATOR */
|
||||||
|
|
|
@ -24,11 +24,6 @@
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
/* (Daniel 2002-10-31) Mingw32 requires this errno variable to be present.
|
|
||||||
I'm not quite sure why and I don't know if this breaks the MSVC compile.
|
|
||||||
If it does, we should put this within #ifdef __MINGW32__ */
|
|
||||||
int errno;
|
|
||||||
|
|
||||||
static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
||||||
|
|
||||||
int set_irq_level (int level)
|
int set_irq_level (int level)
|
||||||
|
|
|
@ -24,11 +24,6 @@
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
/* (Daniel 2002-10-31) Mingw32 requires this errno variable to be present.
|
|
||||||
I'm not quite sure why and I don't know if this breaks the MSVC compile.
|
|
||||||
If it does, we should put this within #ifdef __MINGW32__ */
|
|
||||||
int errno;
|
|
||||||
|
|
||||||
static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
|
||||||
|
|
||||||
int set_irq_level (int level)
|
int set_irq_level (int level)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue