mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
termios.h contains the winsize structure we need to determine the
width of a terminal. Don't try to get the width of a terminal if we don't have this header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72018 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# include <termios.h>
|
||||
#endif
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//=== WARNING: Implementation here must contain only generic UNIX code that
|
||||
@@ -204,7 +207,7 @@ static unsigned getColumns(int FileID) {
|
||||
|
||||
unsigned Columns = 0;
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
|
||||
// Try to determine the width of the terminal.
|
||||
struct winsize ws;
|
||||
if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)
|
||||
|
Reference in New Issue
Block a user