diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-18 17:21:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-18 17:21:34 +0000 |
commit | b81294d9892c1bde188323eff0bf6e92d1b47ced (patch) | |
tree | 064e825a97be6dab16c74992b2fa5566afb07854 /llvm/lib | |
parent | b191180042a323622e9612f4006409d132bfe6cc (diff) | |
download | bcm5719-llvm-b81294d9892c1bde188323eff0bf6e92d1b47ced.tar.gz bcm5719-llvm-b81294d9892c1bde188323eff0bf6e92d1b47ced.zip |
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.
llvm-svn: 72018
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/System/Unix/Process.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Process.inc b/llvm/lib/System/Unix/Process.inc index b1286b7bfcd..e4f37a1ff59 100644 --- a/llvm/lib/System/Unix/Process.inc +++ b/llvm/lib/System/Unix/Process.inc @@ -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) |