diff options
| author | bernard <[email protected]> | 2017-11-30 23:56:52 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-11-30 23:56:52 +0800 |
| commit | ae7237dc53540897a9ea40e145122276bd0b9ddc (patch) | |
| tree | d49a61e59202c15390260732482cf6464358ba6a /include/libc | |
| parent | 2a83353e5f0ff1888feb528689bd4c9e2edeb566 (diff) | |
[BSP] Fix the WIN32 compiling issue.
rename _errno to __rt_errno for conflict in WIN32.
Diffstat (limited to 'include/libc')
| -rw-r--r-- | include/libc/libc_errno.h | 2 | ||||
| -rw-r--r-- | include/libc/libc_fcntl.h | 7 | ||||
| -rw-r--r-- | include/libc/libc_fdset.h | 2 | ||||
| -rw-r--r-- | include/libc/libc_ioctl.h | 6 |
4 files changed, 14 insertions, 3 deletions
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index 7b6f302091..b4f4410595 100644 --- a/include/libc/libc_errno.h +++ b/include/libc/libc_errno.h @@ -27,7 +27,7 @@ #include <rtconfig.h> -#ifdef RT_USING_NEWLIB +#if defined(RT_USING_NEWLIB) || defined(_WIN32) /* use errno.h file in newlib */ #include <errno.h> #else diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h index 68b714b855..fd61b44273 100644 --- a/include/libc/libc_fcntl.h +++ b/include/libc/libc_fcntl.h @@ -4,13 +4,18 @@ #ifndef LIBC_FCNTL_H__ #define LIBC_FCNTL_H__ -#ifdef RT_USING_NEWLIB +#if defined(RT_USING_NEWLIB) || defined(_WIN32) #include <fcntl.h> #ifndef O_NONBLOCK #define O_NONBLOCK 04000 #endif +#if defined(_WIN32) +#define O_DIRECTORY 0200000 +#define O_ACCMODE (_O_RDONLY | _O_WRONLY | _O_RDWR) +#endif + #else #define O_RDONLY 00 #define O_WRONLY 01 diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h index 613b0e9539..386c040206 100644 --- a/include/libc/libc_fdset.h +++ b/include/libc/libc_fdset.h @@ -27,7 +27,7 @@ #include <rtconfig.h> -#ifdef RT_USING_NEWLIB +#if defined(RT_USING_NEWLIB) || defined(_WIN32) #include <sys/types.h> #else diff --git a/include/libc/libc_ioctl.h b/include/libc/libc_ioctl.h index 49191a8548..b61866a524 100644 --- a/include/libc/libc_ioctl.h +++ b/include/libc/libc_ioctl.h @@ -30,6 +30,7 @@ #define _IOC_WRITE 1U #define _IOC_READ 2U +#ifndef _WIN32 #define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) #define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) #define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) @@ -39,6 +40,7 @@ #define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ #define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding * in send queue. */ +#endif #define TCGETS 0x5401 #define TCSETS 0x5402 @@ -98,7 +100,11 @@ #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 + +#ifndef _WIN32 #define FIOASYNC 0x5452 +#endif + #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 |
