增加 __GNUC__宏定义 和sconscript的平台识别以避免重复定义

This commit is contained in:
mysterywolf 2020-09-08 13:16:49 +08:00
parent 0607ff84ab
commit ff097f0467
6 changed files with 8 additions and 7 deletions

View File

@ -16,6 +16,7 @@ else:
if GetDepend('RT_USING_POSIX') == False:
SrcRemove(src, ['unistd.c'])
if not GetDepend('RT_USING_MINILIBC') and GetDepend('RT_USING_LIBC'):
group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH)
Return('group')

View File

@ -8,7 +8,7 @@ group = []
CPPPATH = [cwd]
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 = [''],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)

View File

@ -13,7 +13,7 @@
#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 */
#include <errno.h>
#endif
@ -45,7 +45,7 @@ defined in armcc/errno.h
#define ERROR_BASE_NO 0
#endif
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32)
#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !defined(__GNUC__ )
#define EPERM (ERROR_BASE_NO + 1)
#define ENOENT (ERROR_BASE_NO + 2)

View File

@ -12,7 +12,7 @@
#ifndef 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>
#ifndef O_NONBLOCK

View File

@ -13,7 +13,7 @@
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined(_WIN32)
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined( __GNUC__ )
#include <sys/types.h>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>

View File

@ -9,7 +9,7 @@
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB)
#if defined(RT_USING_NEWLIB) || defined( __GNUC__ )
/* use header file of newlib */
#include <sys/stat.h>