diff options
Diffstat (limited to 'contrib/ncurses/c++')
-rw-r--r-- | contrib/ncurses/c++/Makefile.in | 20 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesf.cc | 4 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesf.h | 4 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesm.cc | 8 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesmain.cc | 14 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesp.cc | 7 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesp.h | 7 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesw.cc | 30 | ||||
-rw-r--r-- | contrib/ncurses/c++/cursesw.h | 33 | ||||
-rw-r--r-- | contrib/ncurses/c++/demo.cc | 77 | ||||
-rwxr-xr-x | contrib/ncurses/c++/edit_cfg.sh | 8 | ||||
-rw-r--r-- | contrib/ncurses/c++/etip.h.in | 16 |
12 files changed, 153 insertions, 75 deletions
diff --git a/contrib/ncurses/c++/Makefile.in b/contrib/ncurses/c++/Makefile.in index 96f338f..9555320 100644 --- a/contrib/ncurses/c++/Makefile.in +++ b/contrib/ncurses/c++/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.58 2001/04/21 21:31:08 tom Exp $ +# $Id: Makefile.in,v 1.64 2002/01/19 20:25:31 NIIBE.Yutaka Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -55,6 +55,9 @@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ AR_OPTS = @AR_OPTS@ + +CXX_AR = @CXX_AR@ +CXX_AR_OPTS = @CXX_AR_OPTS@ RANLIB = @RANLIB@ CXX = @CXX@ @@ -88,9 +91,9 @@ LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ -LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) -l$(LIBROOT)@LIB_SUFFIX@ +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ -LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) ../lib/$(LIBNAME) +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME) LINK_NORMAL = $(LINK_FLAGS) LINK_DEBUG = $(LINK_FLAGS) LINK_PROFILE = $(LINK_FLAGS) @@ -117,6 +120,8 @@ all :: demo$x sources : $(AUTO_SRC) +depend : + # Build a conventional library for installing, since a shared library would # pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct # dependencies. @@ -131,7 +136,7 @@ LIB_OBJS = \ $(MODEL)/cursesmain.o ../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) - $(AR) $(AR_OPTS) $@ $? + $(CXX_AR) $(CXX_AR_OPTS) $@ $? $(RANLIB) $@ ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) @@ -154,7 +159,7 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ install \ install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) @@ -165,9 +170,10 @@ uninstall.libs:: -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) mostlyclean :: - -rm -f core tags TAGS *~ *.i *.ii *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace clean :: mostlyclean + -rm -rf $(MODEL)/SunWS_cache -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(OBJS_DEMO) -rm -rf .libs diff --git a/contrib/ncurses/c++/cursesf.cc b/contrib/ncurses/c++/cursesf.cc index 35e01ee..f25d2d5 100644 --- a/contrib/ncurses/c++/cursesf.cc +++ b/contrib/ncurses/c++/cursesf.cc @@ -35,7 +35,7 @@ #include "cursesf.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesf.cc,v 1.13 2001/03/24 20:03:51 tom Exp $") +MODULE_ID("$Id: cursesf.cc,v 1.14 2001/07/14 20:54:43 juergen Exp $") NCursesFormField::~NCursesFormField () { if (field) @@ -267,7 +267,7 @@ NCursesForm::operator()(void) { show(); refresh(); - while (((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { + while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); diff --git a/contrib/ncurses/c++/cursesf.h b/contrib/ncurses/c++/cursesf.h index 3dc2e95..e3655f2 100644 --- a/contrib/ncurses/c++/cursesf.h +++ b/contrib/ncurses/c++/cursesf.h @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: cursesf.h,v 1.15 2001/03/24 21:41:23 tom Exp $ +// $Id: cursesf.h,v 1.16 2001/07/15 00:02:53 tom Exp $ #ifndef NCURSES_CURSESF_H_incl #define NCURSES_CURSESF_H_incl 1 @@ -265,7 +265,7 @@ public: OnError(::set_field_buffer(field,buffer,val)); } - // Retrieve the value of a fields buffer. The defaukt buffer is nr. 0 + // Retrieve the value of a fields buffer. The default buffer is nr. 0 inline char* value(int buffer = 0) const { return ::field_buffer(field,buffer); } diff --git a/contrib/ncurses/c++/cursesm.cc b/contrib/ncurses/c++/cursesm.cc index 410cdbc..d9b0a63 100644 --- a/contrib/ncurses/c++/cursesm.cc +++ b/contrib/ncurses/c++/cursesm.cc @@ -35,7 +35,7 @@ #include "cursesm.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesm.cc,v 1.15 2001/03/24 20:03:56 tom Exp $") +MODULE_ID("$Id: cursesm.cc,v 1.16 2001/07/14 20:54:43 juergen Exp $") NCursesMenuItem::~NCursesMenuItem() { if (item) @@ -290,9 +290,9 @@ NCursesMenu::operator()(void) { post(); show(); refresh(); - - while (!b_action && ((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { - + + while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); diff --git a/contrib/ncurses/c++/cursesmain.cc b/contrib/ncurses/c++/cursesmain.cc index 03f61bc..6b34b52 100644 --- a/contrib/ncurses/c++/cursesmain.cc +++ b/contrib/ncurses/c++/cursesmain.cc @@ -34,7 +34,7 @@ #include "internal.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesmain.cc,v 1.7 2001/03/24 21:25:47 tom Exp $") +MODULE_ID("$Id: cursesmain.cc,v 1.8 2001/07/14 20:54:43 juergen Exp $") /* This is the default implementation of main() for a NCursesApplication. * You only have to instantiate a static NCursesApplication object in your @@ -45,7 +45,13 @@ int main(int argc, char* argv[]) NCursesApplication* A = NCursesApplication::getApplication(); if (!A) return(1); - A->handleArgs(argc,argv); - ::endwin(); - return((*A)()); + else { + int res; + + A->handleArgs(argc,argv); + ::endwin(); + res = (*A)(); + ::endwin(); + return(res); + } } diff --git a/contrib/ncurses/c++/cursesp.cc b/contrib/ncurses/c++/cursesp.cc index bfd4d9f..7fb5e51 100644 --- a/contrib/ncurses/c++/cursesp.cc +++ b/contrib/ncurses/c++/cursesp.cc @@ -35,7 +35,7 @@ #include "cursesp.h" #include <string.h> -MODULE_ID("$Id: cursesp.cc,v 1.18 2001/03/24 20:04:04 tom Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.19 2001/07/14 20:54:43 juergen Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -122,3 +122,8 @@ NCursesPanel::centertext(int row,const char *label) { OnError(addstr(row, x, label, width())); } } + +int +NCursesPanel::getKey(void) { + return getch(); +} diff --git a/contrib/ncurses/c++/cursesp.h b/contrib/ncurses/c++/cursesp.h index b56580a..1a656f5 100644 --- a/contrib/ncurses/c++/cursesp.h +++ b/contrib/ncurses/c++/cursesp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ #ifndef NCURSES_CURSESP_H_incl #define NCURSES_CURSESP_H_incl 1 -// $Id: cursesp.h,v 1.14 2001/03/24 21:41:35 tom Exp $ +// $Id: cursesp.h,v 1.15 2001/07/14 20:56:18 juergen Exp $ #include <cursesw.h> @@ -79,6 +79,9 @@ protected: // If err is equal to the curses error indicator ERR, an error handler // is called. + // Get a keystroke. Default implementation calls getch() + virtual int getKey(void); + public: NCursesPanel(int lines, int cols, diff --git a/contrib/ncurses/c++/cursesw.cc b/contrib/ncurses/c++/cursesw.cc index 463554b..fb6bd8b1 100644 --- a/contrib/ncurses/c++/cursesw.cc +++ b/contrib/ncurses/c++/cursesw.cc @@ -25,7 +25,7 @@ #include "internal.h" #include "cursesw.h" -MODULE_ID("$Id: cursesw.cc,v 1.21 2001/04/07 22:11:39 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.24 2001/12/08 21:02:33 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -36,6 +36,14 @@ MODULE_ID("$Id: cursesw.cc,v 1.21 2001/04/07 22:11:39 tom Exp $") long NCursesWindow::count = 0L; bool NCursesWindow::b_initialized = FALSE; +/* + * The ncurses library has a fallback for vsscanf(), which may work... + */ +#if !(USE_STRSTREAM_VSCAN || USE_STRSTREAM_VSCAN_CAST) +# undef USE_STDIO_VSCAN +# define USE_STDIO_VSCAN 1 +#endif + #if defined(__GNUG__) # ifndef _IO_va_list # define _IO_va_list char * @@ -46,23 +54,25 @@ int NCursesWindow::scanw(const char* fmt, ...) { int result = ERR; -#if defined(__GNUG__) char buf[BUFSIZ]; if (::wgetnstr(w, buf, sizeof(buf)) != ERR) { va_list args; va_start(args, fmt); #if USE_STDIO_VSCAN - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) result = OK; -#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */ +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = OK; #endif va_end(args); } -#endif return result; } @@ -71,7 +81,6 @@ int NCursesWindow::scanw(int y, int x, const char* fmt, ...) { int result = ERR; -#if defined(__GNUG__) char buf[BUFSIZ]; if (::wmove(w, y, x) != ERR) { @@ -79,9 +88,13 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...) va_list args; va_start(args, fmt); #if USE_STDIO_VSCAN - if (::vscanf(fmt, args) != -1) + if (::vsscanf(buf, fmt, args) != -1) result = OK; -#elif USE_STRSTREAM_VSCAN /* pre-gcc 3.0 */ +#elif USE_STRSTREAM_VSCAN /* powerpc, os390 */ + strstreambuf ss(buf, sizeof(buf)); + if (ss.vscan(fmt, args) != -1) + result = OK; +#elif USE_STRSTREAM_VSCAN_CAST /* pre-gcc 3.0 */ strstreambuf ss(buf, sizeof(buf)); if (ss.vscan(fmt, (_IO_va_list)args) != -1) result = OK; @@ -89,7 +102,6 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...) va_end(args); } } -#endif return result; } diff --git a/contrib/ncurses/c++/cursesw.h b/contrib/ncurses/c++/cursesw.h index dcaadd9..5383399 100644 --- a/contrib/ncurses/c++/cursesw.h +++ b/contrib/ncurses/c++/cursesw.h @@ -30,13 +30,13 @@ #ifndef NCURSES_CURSESW_H_incl #define NCURSES_CURSESW_H_incl 1 -// $Id: cursesw.h,v 1.25 2001/04/07 22:44:07 tom Exp $ +// $Id: cursesw.h,v 1.28 2001/07/15 01:17:56 tom Exp $ #include <etip.h> #include <stdio.h> #include <stdarg.h> -#if HAVE_STRSTREAM_H && USE_STRSTREAM_VSCAN +#if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) #include <strstream.h> #endif @@ -752,7 +752,7 @@ public: int cols, // number of columns int begin_y, // absolute or relative int begin_x, // origins: - char absrel = 'a');// if `a', by & bx are + char absrel = 'a');// if `a', begin_y & begin_x are // absolute screen pos, else if `r', they are relative to par origin NCursesWindow(NCursesWindow& par,// parent window @@ -778,7 +778,7 @@ public: // lowlevel ripoffline() function because it uses the internal // implementation that allows to remove more than just a single line. // This function must be called before any other ncurses function. The - // creation of the window is defered until ncurses gets initialized. + // creation of the window is deferred until ncurses gets initialized. // The initialization function is then called. // ------------------------------------------------------------------------- @@ -796,7 +796,7 @@ public: static int NumberOfColors(); // Number of available colors - int colors() const { return NumberOfColors(); } + int colors() const { return NumberOfColors(); } // Number of available colors // ------------------------------------------------------------------------- @@ -820,25 +820,25 @@ public: int maxy() const { return w->_maxy; } // Largest y coord in window - short getcolor() const; + short getcolor() const; // Actual color pair - short foreground() const { return getcolor(0); } + short foreground() const { return getcolor(0); } // Actual foreground color - short background() const { return getcolor(1); } + short background() const { return getcolor(1); } // Actual background color - int setpalette(short fore, short back); + int setpalette(short fore, short back); // Set color palette entry - int setcolor(short pair); + int setcolor(short pair); // Set actually used palette entry // ------------------------------------------------------------------------- // window positioning // ------------------------------------------------------------------------- - virtual int mvwin(int begin_y, int begin_x) { + virtual int mvwin(int begin_y, int begin_x) { return ::mvwin(w,begin_y,begin_x); } // Move window to new position with the new position as top left corner. // This is virtual because it is redefined in NCursesPanel. @@ -887,8 +887,7 @@ public: // as described above. int scanw(const char* fmt, ...) - // Perform a scanw function from the window. This only works if you're - // using the GNU C++ compiler. + // Perform a scanw function from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 2, 3))); #else @@ -897,7 +896,7 @@ public: int scanw(int y, int x, const char* fmt, ...) // Move the cursor to the requested position and then perform a scanw - // from the window. This nly works if you're using the GNU C++ compiler. + // from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 4, 5))); #else @@ -930,7 +929,7 @@ public: int printw(const char* fmt, ...) // Do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 2, 3))); #else ; @@ -938,7 +937,7 @@ public: int printw(int y, int x, const char * fmt, ...) // Move the cursor and then do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 4, 5))); #else ; @@ -1021,7 +1020,7 @@ public: int box(chtype vert=0, chtype hor=0) { return ::wborder(w, vert, vert, hor, hor, 0, 0 ,0, 0); } // Draw a box around the window with the given vertical and horizontal - // drawing characters. If you specifiy a zero as character, curses will try + // drawing characters. If you specify a zero as character, curses will try // to find a "nice" character. int border(chtype left=0, chtype right=0, diff --git a/contrib/ncurses/c++/demo.cc b/contrib/ncurses/c++/demo.cc index 8db7000..56573cd 100644 --- a/contrib/ncurses/c++/demo.cc +++ b/contrib/ncurses/c++/demo.cc @@ -6,7 +6,7 @@ * Demo code for NCursesMenu and NCursesForm written by * Juergen Pfeifer <juergen.pfeifer@gmx.net> * - * $Id: demo.cc,v 1.20 2001/01/28 02:26:27 tom Exp $ + * $Id: demo.cc,v 1.21 2001/07/15 01:15:26 tom Exp $ */ #include "cursesapp.h" @@ -19,7 +19,7 @@ extern "C" unsigned int sleep(unsigned int); -#undef index // needed for NeXT +#undef index // needed for NeXT // // ------------------------------------------------------------------------- @@ -140,7 +140,7 @@ template<class T> class MyAction : public NCursesUserItem<T> { public: MyAction (const char* p_name, - const T* p_UserData) + const T* p_UserData) : NCursesUserItem<T>(p_name, (const char*)0, p_UserData) {}; @@ -170,7 +170,7 @@ class Label : public NCursesFormField { public: Label(const char* title, - int row, int col) + int row, int col) : NCursesFormField(1,(int)::strlen(title),row,col) { set_value(title); options_off(O_EDIT|O_ACTIVE); @@ -293,18 +293,18 @@ public: for (int i=0; i < PADSIZE; i++) { for (int j=0; j < PADSIZE; j++) { - if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { - if (i==0 || j==0) - FP.addch('+'); - else - FP.addch((chtype)('A' + (gridcount++ % 26))); - } - else if (i % GRIDSIZE == 0) - FP.addch('-'); - else if (j % GRIDSIZE == 0) - FP.addch('|'); - else - FP.addch(' '); + if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { + if (i==0 || j==0) + FP.addch('+'); + else + FP.addch((chtype)('A' + (gridcount++ % 26))); + } + else if (i % GRIDSIZE == 0) + FP.addch('-'); + else if (j % GRIDSIZE == 0) + FP.addch('|'); + else + FP.addch(' '); } } @@ -324,6 +324,49 @@ public: options_off(O_SELECTABLE); } }; + +// +// ------------------------------------------------------------------------- +// +class ScanAction : public NCursesMenuItem +{ +public: + ScanAction(const char* s) : NCursesMenuItem(s) { + } + + bool action() { + NCursesPanel *std = new NCursesPanel(); + + NCursesPanel *w = new NCursesPanel(std->lines() - 2, std->cols() - 2, 1, 1); + w->box(); + w->refresh(); + + NCursesPanel *s = new NCursesPanel(w->lines() - 6, w->cols() - 6, 3, 3); + s->scrollok(TRUE); + ::echo(); + + s->printw("Enter decimal integers. The running total will be shown\n"); + int value = -1; + int result = 0; + while (value != 0) { + value = 0; + s->scanw("%d", &value); + if (value != 0) { + s->printw("%d: ", result += value); + } + s->refresh(); + } + s->printw("\nPress any key to continue..."); + s->getch(); + + delete s; + delete w; + delete std; + ::noecho(); + return FALSE; + } +}; + // // ------------------------------------------------------------------------- // @@ -346,7 +389,7 @@ public: I[2] = new MyAction<UserData> ("Silly", u); I[3] = new FormAction("Form"); I[4] = new PadAction("Pad"); - I[5] = new PassiveItem("Six"); + I[5] = new ScanAction("Scan"); I[6] = new QuitItem(); I[7] = new NCursesMenuItem(); // Terminating empty item diff --git a/contrib/ncurses/c++/edit_cfg.sh b/contrib/ncurses/c++/edit_cfg.sh index e2f828a..e0c1822 100755 --- a/contrib/ncurses/c++/edit_cfg.sh +++ b/contrib/ncurses/c++/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.10 2001/04/07 22:45:11 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/08 20:44:59 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -47,8 +47,8 @@ for name in \ HAVE_STRSTREAM_H \ HAVE_TYPEINFO \ HAVE_VALUES_H \ - USE_STDIO_VSCAN \ - USE_STRSTREAM_VSCAN + USE_STRSTREAM_VSCAN \ + USE_STRSTREAM_VSCAN_CAST do mv $2 $2.bak if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) diff --git a/contrib/ncurses/c++/etip.h.in b/contrib/ncurses/c++/etip.h.in index d3421d2..85e4df2 100644 --- a/contrib/ncurses/c++/etip.h.in +++ b/contrib/ncurses/c++/etip.h.in @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $Id: etip.h.in,v 1.18 2001/04/07 22:45:04 tom Exp $ +// $Id: etip.h.in,v 1.22 2001/12/08 21:26:49 tom Exp $ #ifndef NCURSES_ETIP_H_incl #define NCURSES_ETIP_H_incl 1 @@ -73,14 +73,14 @@ #define CPP_HAS_PARAM_INIT 0 #endif -#ifndef USE_STDIO_VSCAN -#define USE_STDIO_VSCAN 0 -#endif - #ifndef USE_STRSTREAM_VSCAN #define USE_STRSTREAM_VSCAN 0 #endif +#ifndef USE_STRSTREAM_VSCAN_CAST +#define USE_STRSTREAM_VSCAN_CAST 0 +#endif + #ifdef __GNUG__ # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) # if HAVE_TYPEINFO @@ -274,8 +274,12 @@ inline void THROW(const NCursesException *e) { throw *e; #endif #elif defined(__SUNPRO_CC) +# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) genericerror(1, ((e != 0) ? (char *)(e->message) : "")); #else + throw *e; +#endif +#else if (e) cerr << e->message << endl; exit(0); |