+2020-05-16 Tom Tromey <tom@tromey.com>
+
+ * top.c (quit_force): Update.
+ * infrun.c (handle_no_resumed): Update.
+ * top.h (all_uis): New function.
+ (ALL_UIS): Remove.
+
2020-05-16 Simon Marchi <simon.marchi@efficios.com>
* mips-linux-tdep.c (mips_linux_in_dynsym_stub): Fix condition.
{
if (target_can_async_p ())
{
- struct ui *ui;
int any_sync = 0;
- ALL_UIS (ui)
+ for (ui *ui : all_uis ())
{
if (ui->prompt_state == PROMPT_BLOCKED)
{
{
if (write_history_p && history_filename)
{
- struct ui *ui;
int save = 0;
/* History is currently shared between all UIs. If there's
any UI with a terminal, save history. */
- ALL_UIS (ui)
+ for (ui *ui : all_uis ())
{
if (input_interactive_p (ui))
{
#include "gdbsupport/buffer.h"
#include "gdbsupport/event-loop.h"
+#include "gdbsupport/next-iterator.h"
#include "value.h"
struct tl_interp_info;
#define SWITCH_THRU_ALL_UIS() \
for (switch_thru_all_uis stau_state; !stau_state.done (); stau_state.next ())
-/* Traverse over all UIs. */
-#define ALL_UIS(UI) \
- for (UI = ui_list; UI; UI = UI->next) \
+/* An adapter that can be used to traverse over all UIs. */
+static inline
+next_adapter<ui> all_uis ()
+{
+ return next_adapter<ui> (ui_list);
+}
/* Register the UI's input file descriptor in the event loop. */
extern void ui_register_input_event_handler (struct ui *ui);