diff options
author | Brad King <brad.king@kitware.com> | 2011-01-05 16:07:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-01-05 16:07:24 (GMT) |
commit | dde0c89cfcec22ac75cbadd77e45d2113521f326 (patch) | |
tree | 2165bb2734227b2f3ca5239210863120c7121fc6 | |
parent | a3de30eed95cbcff75aeb654710f8b43a8dfa90d (diff) | |
download | CMake-dde0c89cfcec22ac75cbadd77e45d2113521f326.zip CMake-dde0c89cfcec22ac75cbadd77e45d2113521f326.tar.gz CMake-dde0c89cfcec22ac75cbadd77e45d2113521f326.tar.bz2 |
ccmake: Use LSB 4.0 getmaxyx conditionally
Use of 'getmaxyx' works on LSB but does not seem portable to other
curses versions.
-rw-r--r-- | Source/CursesDialog/form/frm_driver.c | 13 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_post.c | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index 80f09d0..03896c2 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -357,7 +357,12 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win) assert(win && field); +#if defined(__LSB_VERSION__) getmaxyx(win, height, width); +#else + width = getmaxx(win); + height = getmaxy(win); +#endif for(row=0, pBuffer=field->buf; row < height; @@ -389,13 +394,17 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field) int pad; int len = 0; char *p; - int row, height, width; + int row, height; assert(win && field && field->buf ); pad = field->pad; p = field->buf; - getmaxyx(win, height, width); +#if defined(__LSB_VERSION__) + { int width; getmaxyx(win, height, width); } +#else + height = getmaxy(win); +#endif for(row=0; (row < height) && (row < field->drows); row++ ) { diff --git a/Source/CursesDialog/form/frm_post.c b/Source/CursesDialog/form/frm_post.c index 924fe6a..3c63de7 100644 --- a/Source/CursesDialog/form/frm_post.c +++ b/Source/CursesDialog/form/frm_post.c @@ -63,7 +63,12 @@ int post_form(FORM * form) RETURN(E_NOT_CONNECTED); formwin = Get_Form_Window(form); +#if defined(__LSB_VERSION__) getmaxyx(formwin, height, width); +#else + width = getmaxx(formwin); + height = getmaxy(formwin); +#endif if ((form->cols > width) || (form->rows > height)) RETURN(E_NO_ROOM); |