From ee3d06a41ec6b5355083a3eba36cf73a5438c1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85dne=20Hovda?= Date: Mon, 17 Nov 2014 13:24:40 +0100 Subject: [PATCH 1/3] ccmake: Remove incomplete support for cur_colr on old HP-UX Enable support for the more modern Xcurses. --- Source/CursesDialog/form/form.priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CursesDialog/form/form.priv.h b/Source/CursesDialog/form/form.priv.h index 3691f2fd0..889c6e4ec 100644 --- a/Source/CursesDialog/form/form.priv.h +++ b/Source/CursesDialog/form/form.priv.h @@ -34,7 +34,7 @@ #include "form.h" /* get around odd bug on aCC and itanium */ -#if defined(__hpux) && defined(__ia64) +#if defined(__hpux) #define getmaxx __getmaxx #define getmaxy __getmaxy #endif From 44f02b42fb3b2278fdf8e9bd450c3f01573d1e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85dne=20Hovda?= Date: Tue, 18 Nov 2014 10:04:30 +0100 Subject: [PATCH 2/3] ccmake: Use standard getmaxyx instead of non-standard getmax[xy] Swap out getmax[xy]() calls for single call to getmaxyx(), to support strict X/Open conformant curses implementations, e.g. HP-UX Xcurses. --- Source/CursesDialog/form/form.priv.h | 6 ------ Source/CursesDialog/form/frm_driver.c | 13 ++----------- Source/CursesDialog/form/frm_post.c | 5 ----- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Source/CursesDialog/form/form.priv.h b/Source/CursesDialog/form/form.priv.h index 889c6e4ec..8516a6ffd 100644 --- a/Source/CursesDialog/form/form.priv.h +++ b/Source/CursesDialog/form/form.priv.h @@ -33,12 +33,6 @@ #include "mf_common.h" #include "form.h" -/* get around odd bug on aCC and itanium */ -#if defined(__hpux) -#define getmaxx __getmaxx -#define getmaxy __getmaxy -#endif - /* form status values */ #define _OVLMODE (0x04) /* Form is in overlay mode */ #define _WINDOW_MODIFIED (0x10) /* Current field window has been modified */ diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index b9611bf10..db2ee50d9 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -357,12 +357,7 @@ 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; @@ -394,17 +389,13 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field) int pad; int len = 0; char *p; - int row, height; + int row, height, width; assert(win && field && field->buf ); pad = field->pad; p = field->buf; -#if defined(__LSB_VERSION__) - { int width; getmaxyx(win, height, width); } -#else - height = getmaxy(win); -#endif + getmaxyx(win, height, width); 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 3c63de70e..924fe6a9e 100644 --- a/Source/CursesDialog/form/frm_post.c +++ b/Source/CursesDialog/form/frm_post.c @@ -63,12 +63,7 @@ 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); From 7a68729223c05d779188de89066de414d131dbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85dne=20Hovda?= Date: Tue, 18 Nov 2014 11:40:05 +0100 Subject: [PATCH 3/3] ccmake: Cleanup and simplify conditional blocks for HP-UX --- .../CursesDialog/cmCursesStandardIncludes.h | 25 ++----------------- Source/CursesDialog/form/fld_attr.c | 8 +----- Source/CursesDialog/form/form.h | 10 ++++++++ Source/CursesDialog/form/frm_driver.c | 6 ----- Source/CursesDialog/form/frm_req_name.c | 6 ----- 5 files changed, 13 insertions(+), 42 deletions(-) diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index b157a289b..791ac9b59 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -15,30 +15,13 @@ #define _MSE_INT_H #endif -#include - #if defined(__hpux) # define _BOOL_DEFINED # include -# define _XOPEN_SOURCE_EXTENDED -# include -# include -# undef _XOPEN_SOURCE_EXTENDED -#else -/* figure out which curses.h to include */ -# if defined(CURSES_HAVE_NCURSES_H) -# include -# elif defined(CURSES_HAVE_NCURSES_NCURSES_H) -# include -# elif defined(CURSES_HAVE_NCURSES_CURSES_H) -# include -# else -# include -# endif - -# include #endif +#include + // This is a hack to prevent warnings about these functions being // declared but not referenced. #if defined(__sgi) && !defined(__GNUC__) @@ -57,10 +40,6 @@ public: }; #endif -#ifndef getmaxyx - #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w)) -#endif - // on some machines move erase and clear conflict with stl // so remove them from the namespace diff --git a/Source/CursesDialog/form/fld_attr.c b/Source/CursesDialog/form/fld_attr.c index 86195882b..35ea9033c 100644 --- a/Source/CursesDialog/form/fld_attr.c +++ b/Source/CursesDialog/form/fld_attr.c @@ -29,13 +29,7 @@ /**************************************************************************** * Author: Juergen Pfeifer 1995,1997 * ****************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif - #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif +#include "form.priv.h" MODULE_ID("$Id$") /*---------------------------------------------------------------------------- diff --git a/Source/CursesDialog/form/form.h b/Source/CursesDialog/form/form.h index 94f05af8a..1219cb5f2 100644 --- a/Source/CursesDialog/form/form.h +++ b/Source/CursesDialog/form/form.h @@ -47,7 +47,17 @@ # elif defined(CURSES_HAVE_NCURSES_CURSES_H) # include # else +# if defined(__hpux) +# if defined(_XOPEN_SOURCE_EXTENDED) +# define HAVE__XOPEN_SOURCE_EXTENDED +# else +# define _XOPEN_SOURCE_EXTENDED +# endif +# endif # include +# if defined(__hpux) && !defined(HAVE__XOPEN_SOURCE_EXTENDED) +# undef _XOPEN_SOURCE_EXTENDED +# endif # endif #include diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index db2ee50d9..26f580e45 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -29,13 +29,7 @@ /**************************************************************************** * Author: Juergen Pfeifer 1995,1997 * ****************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif /* AIX seems to define this */ #undef lines diff --git a/Source/CursesDialog/form/frm_req_name.c b/Source/CursesDialog/form/frm_req_name.c index b108dabe4..6fb9183b3 100644 --- a/Source/CursesDialog/form/frm_req_name.c +++ b/Source/CursesDialog/form/frm_req_name.c @@ -35,13 +35,7 @@ * Routines to handle external names of menu requests * ***************************************************************************/ -#if defined(__hpux) - #define _XOPEN_SOURCE_EXTENDED -#endif #include "form.priv.h" -#if defined(__hpux) - #undef _XOPEN_SOURCE_EXTENDED -#endif MODULE_ID("$Id$")