Merge pull request #11959 from hugueskamba/hk-fix-minimal-console

Minimal Console: Fix compilation error
pull/11980/head
Martin Kojtal 2019-11-28 15:47:20 +01:00 committed by GitHub
commit d58e9d6e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -573,10 +573,10 @@ extern "C" {
ssize_t write(int fildes, const void *buf, size_t nbyte);
ssize_t read(int fildes, void *buf, size_t nbyte);
int fsync(int fildes);
int isatty(int fildes);
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
off_t lseek(int fildes, off_t offset, int whence);
int ftruncate(int fildes, off_t length);
int isatty(int fildes);
int fstat(int fildes, struct stat *st);
int fcntl(int fildes, int cmd, ...);
int poll(struct pollfd fds[], nfds_t nfds, int timeout);

View File

@ -948,17 +948,13 @@ extern "C" int PREFIX(_istty)(FILEHANDLE fh)
extern "C" int _isatty(FILEHANDLE fh)
#endif
{
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
return isatty(fh);
#else
// Is attached to an interactive device
return 1;
#endif // !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
}
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
extern "C" int isatty(int fildes)
{
#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
FileHandle *fhc = mbed_file_handle(fildes);
if (fhc == NULL) {
errno = EBADF;
@ -972,8 +968,11 @@ extern "C" int isatty(int fildes)
} else {
return tty;
}
}
#else
// Is attached to an interactive device
return 1;
#endif // !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
}
extern "C"
#if defined(__ARMCC_VERSION)