resize_term -> resizeterm

Apparently we do need to call the "outer-level" function.
This commit is contained in:
Přemysl Eric Janouch 2015-01-20 23:56:29 +01:00
parent a5e0c0ea71
commit bb9802f83d
3 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ include_directories (${ZLIB_INCLUDE_DIRS}
# Configuration # Configuration
include (CheckFunctionExists) include (CheckFunctionExists)
set (CMAKE_REQUIRED_LIBRARIES ${dependencies_LIBRARIES}) set (CMAKE_REQUIRED_LIBRARIES ${dependencies_LIBRARIES})
CHECK_FUNCTION_EXISTS ("resize_term" HAVE_RESIZE_TERM) CHECK_FUNCTION_EXISTS ("resizeterm" HAVE_RESIZETERM)
# Localization # Localization
find_package (Gettext REQUIRED) find_package (Gettext REQUIRED)

View File

@ -8,7 +8,7 @@
#define GETTEXT_PACKAGE PROJECT_NAME #define GETTEXT_PACKAGE PROJECT_NAME
#define GETTEXT_DIRNAME "${CMAKE_INSTALL_PREFIX}/share/locale" #define GETTEXT_DIRNAME "${CMAKE_INSTALL_PREFIX}/share/locale"
#cmakedefine HAVE_RESIZE_TERM #cmakedefine HAVE_RESIZETERM
#endif /* ! CONFIG_H */ #endif /* ! CONFIG_H */

View File

@ -85,19 +85,19 @@ xstrtoul (unsigned long *out, const char *s, int base)
void void
update_curses_terminal_size (void) update_curses_terminal_size (void)
{ {
#if defined (HAVE_RESIZE_TERM) && defined (TIOCGWINSZ) #if defined (HAVE_RESIZETERM) && defined (TIOCGWINSZ)
struct winsize size; struct winsize size;
if (!ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &size)) if (!ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &size))
{ {
char *row = getenv ("LINES"); char *row = getenv ("LINES");
char *col = getenv ("COLUMNS"); char *col = getenv ("COLUMNS");
unsigned long tmp; unsigned long tmp;
resize_term ( resizeterm (
(row && xstrtoul (&tmp, row, 10)) ? tmp : size.ws_row, (row && xstrtoul (&tmp, row, 10)) ? tmp : size.ws_row,
(col && xstrtoul (&tmp, col, 10)) ? tmp : size.ws_col); (col && xstrtoul (&tmp, col, 10)) ? tmp : size.ws_col);
} }
#else // HAVE_RESIZE_TERM && TIOCGWINSZ #else // HAVE_RESIZETERM && TIOCGWINSZ
endwin (); endwin ();
refresh (); refresh ();
#endif // HAVE_RESIZE_TERM && TIOCGWINSZ #endif // HAVE_RESIZETERM && TIOCGWINSZ
} }