Convert many #ifdef SIMULATOR to #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (and similar).
[kugel-rb.git] / apps / plugins / lua / rocklibc.h
blob44f916fded98e69f813f56a5ad530b6a41b83ebf
2 /***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
11 * Copyright (C) 2008 Dan Everton (safetydan)
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
23 #ifndef _ROCKLIBC_H_
24 #define _ROCKLIBC_H_
26 #include <ctype.h>
27 #include "plugin.h"
29 #if (CONFIG_PLATFORM & PLATFORM_HOSTED)
30 #include <errno.h>
31 #define PREFIX(_x_) sim_ ## _x_
32 #else
33 extern int errno;
34 #define EINVAL 22 /* Invalid argument */
35 #define ERANGE 34 /* Math result not representable */
36 #define PREFIX
37 #endif
39 #define __likely LIKELY
40 #define __unlikely UNLIKELY
42 /* Simple substitutions */
43 #define memcmp rb->memcmp
44 #define strlen rb->strlen
46 extern int PREFIX(fscanf)(int fd, const char *fmt, ...);
48 #endif /* _ROCKLIBC_H_ */