llvm.org GIT mirror llvm / 071d73d
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 Douglas Gregor 11 years ago
6 changed file(s) with 16 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
822822 AC_HEADER_TIME
823823
824824 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
825 AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
826 AC_CHECK_HEADERS([windows.h])
825 AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h])
826 AC_CHECK_HEADERS([utime.h windows.h])
827827 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
828828 AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h])
829829 if test "$ENABLE_THREADS" -eq 1 ; then
3333 check_include_file(sys/stat.h HAVE_SYS_STAT_H)
3434 check_include_file(sys/time.h HAVE_SYS_TIME_H)
3535 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
36 check_include_file(termios.h HAVE_TERMIOS_H)
3637 check_include_file(unistd.h HAVE_UNISTD_H)
3738 check_include_file(utime.h HAVE_UTIME_H)
3839 check_include_file(windows.h HAVE_WINDOWS_H)
2896228962
2896328963
2896428964
28965 for ac_header in malloc.h setjmp.h signal.h stdint.h unistd.h utime.h
28965 for ac_header in malloc.h setjmp.h signal.h stdint.h termios.h unistd.h
2896628966 do
2896728967 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2896828968 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
2913129131 done
2913229132
2913329133
29134 for ac_header in windows.h
29134
29135 for ac_header in utime.h windows.h
2913529136 do
2913629137 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2913729138 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
417417
418418 /* Define to 1 if the system has the type `uint64_t'. */
419419 #undef HAVE_UINT64_T
420
421 /* Define to 1 if you have the header file. */
422 #cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H}
420423
421424 /* Define to 1 if you have the header file. */
422425 #cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
417417
418418 /* Define to 1 if you have that is POSIX.1 compatible. */
419419 #undef HAVE_SYS_WAIT_H
420
421 /* Define to 1 if you have the header file. */
422 #undef HAVE_TERMIOS_H
420423
421424 /* Define to 1 if the system has the type `uint64_t'. */
422425 #undef HAVE_UINT64_T
2525 #endif
2626 #ifdef HAVE_SYS_IOCTL_H
2727 # include
28 #endif
29 #ifdef HAVE_TERMIOS_H
30 # include
2831 #endif
2932
3033 //===----------------------------------------------------------------------===//
203206
204207 unsigned Columns = 0;
205208
206 #ifdef HAVE_SYS_IOCTL_H
209 #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
207210 // Try to determine the width of the terminal.
208211 struct winsize ws;
209212 if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)