diff options
| author | Bernard Xiong <[email protected]> | 2020-09-11 13:20:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-11 13:20:50 +0800 |
| commit | ac751db6703f8117c8f3db5b612536cddf59bdcc (patch) | |
| tree | 5d14525930868492bd142e9026a5e3c50fc42738 /include | |
| parent | 36cb4349a61d768c5e2fad0798647dfb3e0b523e (diff) | |
| parent | b3ab8a99e10f68042a3f2cba11e130004aa124e4 (diff) | |
Merge pull request #3888 from mysterywolf/master
[add] [libc] libc新增getline/getdelim函数(posix.1-2008)
Diffstat (limited to 'include')
| -rw-r--r-- | include/libc/libc_errno.h | 4 | ||||
| -rw-r--r-- | include/libc/libc_fcntl.h | 6 | ||||
| -rw-r--r-- | include/libc/libc_fdset.h | 6 | ||||
| -rw-r--r-- | include/libc/libc_ioctl.h | 4 | ||||
| -rw-r--r-- | include/libc/libc_limits.h | 25 | ||||
| -rw-r--r-- | include/libc/libc_signal.h | 5 | ||||
| -rw-r--r-- | include/libc/libc_stat.h | 2 | ||||
| -rw-r--r-- | include/libc/libc_stdio.h | 22 | ||||
| -rw-r--r-- | include/rtlibc.h | 2 |
9 files changed, 57 insertions, 19 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 1b7c69b1f4..39740b7d85 100644 --- a/include/libc/libc_fcntl.h +++ b/include/libc/libc_fcntl.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : libc_fcntl.h * * Change Logs: * Date Author Notes @@ -16,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 ecd965cd22..4a778b51c1 100644 --- a/include/libc/libc_fdset.h +++ b/include/libc/libc_fdset.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : libc_errno.h * * Change Logs: * Date Author Notes @@ -17,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_ioctl.h b/include/libc/libc_ioctl.h index ef5a5257a8..42a21a2cea 100644 --- a/include/libc/libc_ioctl.h +++ b/include/libc/libc_ioctl.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : libc_ioctl.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_limits.h b/include/libc/libc_limits.h new file mode 100644 index 0000000000..b8368160df --- /dev/null +++ b/include/libc/libc_limits.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-09-05 Meco Manthe first version + */ + +#ifndef LIBC_LIMITS_H__ +#define LIBC_LIMITS_H__ + +#include <limits.h> +#include <rtconfig.h> + +#ifdef RT_USING_POSIX + +#ifndef SSIZE_MAX +# define SSIZE_MAX LONG_MAX +#endif + +#endif + +#endif diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 898fe13f43..539685de3e 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -15,6 +15,7 @@ extern "C" { #endif +#include <stdint.h> #ifdef HAVE_CCONFIG_H #include <cconfig.h> #endif @@ -46,8 +47,8 @@ struct sigevent #ifndef HAVE_SIGINFO struct siginfo { - rt_uint16_t si_signo; - rt_uint16_t si_code; + uint16_t si_signo; + uint16_t si_code; union sigval si_value; }; 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> diff --git a/include/libc/libc_stdio.h b/include/libc/libc_stdio.h new file mode 100644 index 0000000000..85ba509852 --- /dev/null +++ b/include/libc/libc_stdio.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-09-05 Meco Manthe first version + */ + +#ifndef LIBC_STDIO_H__ +#define LIBC_STDIO_H__ + +#include <rtconfig.h> + +#ifdef RT_USING_POSIX_GETLINE + +#include <posix_getline.h> + +#endif + +#endif diff --git a/include/rtlibc.h b/include/rtlibc.h index b3a548beb1..fb8c782095 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -20,6 +20,8 @@ #include "libc/libc_dirent.h" #include "libc/libc_signal.h" #include "libc/libc_fdset.h" +#include "libc/libc_limits.h" +#include "libc/libc_stdio.h" #if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) typedef signed long off_t; |
