add more stub for newlib porting.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@669 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2010-04-26 10:21:24 +00:00
parent c8efa6b331
commit 914e281892
4 changed files with 65 additions and 4 deletions

View File

@ -22,7 +22,7 @@ if 'RT_USING_LWIP' in dir(rtconfig) and rtconfig.RT_USING_LWIP:
objs = objs + SConscript('net/lwip/SConscript') objs = objs + SConscript('net/lwip/SConscript')
if 'RT_USING_MODBUS' in dir(rtconfig) and rtconfig.RT_USING_MODBUS: if 'RT_USING_MODBUS' in dir(rtconfig) and rtconfig.RT_USING_MODBUS:
objs = objs + SConscript('net//freemodbus/SConscript') objs = objs + SConscript('net/freemodbus/SConscript')
if 'RT_USING_RTGUI' in dir(rtconfig) and rtconfig.RT_USING_RTGUI: if 'RT_USING_RTGUI' in dir(rtconfig) and rtconfig.RT_USING_RTGUI:
objs = objs + SConscript('rtgui/SConscript') objs = objs + SConscript('rtgui/SConscript')
@ -30,6 +30,5 @@ if 'RT_USING_RTGUI' in dir(rtconfig) and rtconfig.RT_USING_RTGUI:
# build each modules # build each modules
if rtconfig.CROSS_TOOL == 'gcc': if rtconfig.CROSS_TOOL == 'gcc':
SConscript('hello/SConscript') SConscript('hello/SConscript')
SConscript('thread/SConscript')
Return('objs') Return('objs')

View File

@ -59,6 +59,7 @@
/*@{*/ /*@{*/
#if defined(RT_USING_NEWLIB) || defined (RT_USING_MINILIBC) #if defined(RT_USING_NEWLIB) || defined (RT_USING_MINILIBC)
#include <sys/types.h>
#include <string.h> #include <string.h>
#else #else
typedef unsigned char u_char; typedef unsigned char u_char;

View File

@ -0,0 +1,12 @@
#include <math.h>
/* Fix me */
double sin(double x)
{
#warning sin function not supported for this platform
}
double cos(double x)
{
#warning cos function not supported for this platform
}

View File

@ -1,8 +1,57 @@
#include <reent.h> #include <reent.h>
#include <sys/errno.h>
int _fork_r (struct _reent *ptr) int _fork_r (struct _reent *r)
{ {
/* return "not supported" */ /* return "not supported" */
ptr->errno = ENOTSUP; r->_errno = ENOTSUP;
return -1; return -1;
} }
_ssize_t
_read_r (struct _reent *r, int fd, void *buf, size_t nbytes)
{
_ssize_t rc;
rc = -1;
/* return "not supported" */
r->_errno = ENOTSUP;
return rc;
}
_ssize_t
_write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)
{
_ssize_t rc;
rc = -1;
/* return "not supported" */
r->_errno = ENOTSUP;
return rc;
}
int
_close_r (struct _reent *r, int fd)
{
_ssize_t rc;
rc = -1;
/* return "not supported" */
r->_errno = ENOTSUP;
return rc;
}
_off_t
_lseek_r (struct _reent *r, int fd, _off_t offset, int whence)
{
_ssize_t rc;
rc = -1;
/* return "not supported" */
r->_errno = ENOTSUP;
return rc;
}