// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 1998-2012,2017 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-class NCURSES_IMPEXP NCursesPanel;
-class NCURSES_IMPEXP NCursesMenu;
-class NCURSES_IMPEXP NCursesForm;
+class NCURSES_CXX_IMPEXP NCursesPanel;
+class NCURSES_CXX_IMPEXP NCursesMenu;
+class NCURSES_CXX_IMPEXP NCursesForm;
{
public:
const NCursesPanel* p;
NCursesPanelException (const char *msg, int err) :
NCursesException (msg, err),
{
public:
const NCursesPanel* p;
NCursesPanelException (const char *msg, int err) :
NCursesException (msg, err),
NCursesPanelException (int err) :
NCursesException ("panel library error", err),
NCursesPanelException (int err) :
NCursesException ("panel library error", err),
{
public:
const NCursesMenu* m;
NCursesMenuException (const char *msg, int err) :
NCursesException (msg, err),
{
public:
const NCursesMenu* m;
NCursesMenuException (const char *msg, int err) :
NCursesException (msg, err),
NCursesMenuException (int err) :
NCursesException ("menu library error", err),
NCursesMenuException (int err) :
NCursesException ("menu library error", err),
{
public:
const NCursesForm* f;
NCursesFormException (const char *msg, int err) :
NCursesException (msg, err),
{
public:
const NCursesForm* f;
NCursesFormException (const char *msg, int err) :
NCursesException (msg, err),
NCursesFormException (int err) :
NCursesException ("form library error", err),
NCursesFormException (int err) :
NCursesException ("form library error", err),
#endif
inline void THROW(const NCursesException *e) {
#if defined(__GNUG__) && defined(__EXCEPTIONS)
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
(*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
#endif
inline void THROW(const NCursesException *e) {
#if defined(__GNUG__) && defined(__EXCEPTIONS)
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
(*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
-#else
-#define CPP_HAS_TRY_CATCH 1
-#endif
+# elif (__GNUG__ >= 7)
+ // g++ 7.0 warns about deprecation, but lacks the predefined symbols
+ ::endwin();
+ std::cerr << "Found a problem - goodbye" << std::endl;
+ exit(EXIT_FAILURE);
+# else
+# define CPP_HAS_TRY_CATCH 1
+# endif
#elif defined(__SUNPRO_CC)
# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
#elif defined(__SUNPRO_CC)
# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
#define NCURSES_CPP_TRY /* nothing */
#define NCURSES_CPP_CATCH(e) if (false)
#define THROWS(s) /* nothing */
#define NCURSES_CPP_TRY /* nothing */
#define NCURSES_CPP_CATCH(e) if (false)
#define THROWS(s) /* nothing */
+#if defined(__cpp_noexcept_function_type) && (__cpp_noexcept_function_type >= 201510)
+// C++17 deprecates the usage of throw().
+#define THROWS(s) /* nothing */
+#define THROW2(s,t) /* nothing */
+#else