summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormysterywolf <[email protected]>2020-09-08 13:16:49 +0800
committermysterywolf <[email protected]>2020-09-08 13:16:49 +0800
commitff097f0467fb0041817846f2472343b7b9c098c4 (patch)
tree4d8ba3e5cd42efc7c7fff55f6301b85d34db60be /include
parent0607ff84ab4cf9a8b6ed92ce17776bd852d9bc62 (diff)
增加 __GNUC__宏定义 和sconscript的平台识别以避免重复定义
Diffstat (limited to 'include')
-rw-r--r--include/libc/libc_errno.h4
-rw-r--r--include/libc/libc_fcntl.h2
-rw-r--r--include/libc/libc_fdset.h2
-rw-r--r--include/libc/libc_stat.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h
index 0f3bc7635a..00c1f733d3 100644
--- a/include/libc/libc_errno.h
+++ b/include/libc/libc_errno.h
@@ -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)
diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h
index 385ac7cd9f..39740b7d85 100644
--- a/include/libc/libc_fcntl.h
+++ b/include/libc/libc_fcntl.h
@@ -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
diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h
index b4d2e2189a..4a778b51c1 100644
--- a/include/libc/libc_fdset.h
+++ b/include/libc/libc_fdset.h
@@ -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>
diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h
index 9079d1ef15..9388688572 100644
--- a/include/libc/libc_stat.h
+++ b/include/libc/libc_stat.h
@@ -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>