增加 __GNUC__宏定义 和sconscript的平台识别以避免重复定义
This commit is contained in:
parent
0607ff84ab
commit
ff097f0467
|
@ -16,6 +16,7 @@ else:
|
||||||
if GetDepend('RT_USING_POSIX') == False:
|
if GetDepend('RT_USING_POSIX') == False:
|
||||||
SrcRemove(src, ['unistd.c'])
|
SrcRemove(src, ['unistd.c'])
|
||||||
|
|
||||||
group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH)
|
if not GetDepend('RT_USING_MINILIBC') and GetDepend('RT_USING_LIBC'):
|
||||||
|
group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -8,7 +8,7 @@ group = []
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
CPPDEFINES = ['RT_USING_MINILIBC']
|
CPPDEFINES = ['RT_USING_MINILIBC']
|
||||||
|
|
||||||
if rtconfig.PLATFORM == 'gcc' and rtconfig.ARCH != 'sim' and not GetDepend('RT_USING_LIBC'):
|
if rtconfig.PLATFORM == 'gcc' and rtconfig.ARCH != 'sim' and not GetDepend('RT_USING_LIBC') and GetDepend('RT_USING_MINILIBC'):
|
||||||
group = DefineGroup('libc', src, depend = [''],
|
group = DefineGroup('libc', src, depend = [''],
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <rtconfig.h>
|
#include <rtconfig.h>
|
||||||
|
|
||||||
#if defined(RT_USING_NEWLIB) || defined(_WIN32)
|
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
|
||||||
/* use errno.h file in toolchains */
|
/* use errno.h file in toolchains */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,7 +45,7 @@ defined in armcc/errno.h
|
||||||
#define ERROR_BASE_NO 0
|
#define ERROR_BASE_NO 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32)
|
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !defined(__GNUC__ )
|
||||||
|
|
||||||
#define EPERM (ERROR_BASE_NO + 1)
|
#define EPERM (ERROR_BASE_NO + 1)
|
||||||
#define ENOENT (ERROR_BASE_NO + 2)
|
#define ENOENT (ERROR_BASE_NO + 2)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#ifndef LIBC_FCNTL_H__
|
#ifndef LIBC_FCNTL_H__
|
||||||
#define LIBC_FCNTL_H__
|
#define LIBC_FCNTL_H__
|
||||||
|
|
||||||
#if defined(RT_USING_NEWLIB) || defined(_WIN32)
|
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifndef O_NONBLOCK
|
#ifndef O_NONBLOCK
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <rtconfig.h>
|
#include <rtconfig.h>
|
||||||
|
|
||||||
#if defined(RT_USING_NEWLIB) || defined(_WIN32)
|
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined(HAVE_SYS_SELECT_H)
|
#if defined(HAVE_SYS_SELECT_H)
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <rtconfig.h>
|
#include <rtconfig.h>
|
||||||
|
|
||||||
#if defined(RT_USING_NEWLIB)
|
#if defined(RT_USING_NEWLIB) || defined( __GNUC__ )
|
||||||
/* use header file of newlib */
|
/* use header file of newlib */
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue