#if !defined (INFERIOR_H)
#define INFERIOR_H 1
+#include <exception>
+
struct target_waitstatus;
struct frame_info;
struct ui_file;
/* If we are restoring the inferior state due to an exception,
some error message will be printed. So, only warn the user
when we cannot restore during normal execution. */
- if (!std::uncaught_exception ())
+ bool unwinding;
+#if __cpp_lib_uncaught_exceptions
+ unwinding = std::uncaught_exceptions () > 0;
+#else
+ unwinding = std::uncaught_exception ();
+#endif
+ if (!unwinding)
warning (_("Failed to restore inferior state: %s"), e.what ());
}
}