PR22348, conflicting global vars in crx and cr16
[deliverable/binutils-gdb.git] / gdb / ui-out.h
index d9838379b4b608de324da31e0d90016fff248876..519ff1a85b6c4c0964b2aec43af5c1f0e08f5254 100644 (file)
@@ -204,9 +204,7 @@ public:
     m_uiout->end (Type);
   }
 
-  ui_out_emit_type (const ui_out_emit_type<Type> &) = delete;
-  ui_out_emit_type<Type> &operator= (const ui_out_emit_type<Type> &)
-      = delete;
+  DISABLE_COPY_AND_ASSIGN (ui_out_emit_type<Type>);
 
 private:
 
@@ -242,4 +240,27 @@ private:
   struct ui_out *m_uiout;
 };
 
+/* On destruction, pop the last redirection by calling the uiout's
+   redirect method with a NULL parameter.  */
+class ui_out_redirect_pop
+{
+public:
+
+  ui_out_redirect_pop (ui_out *uiout)
+    : m_uiout (uiout)
+  {
+  }
+
+  ~ui_out_redirect_pop ()
+  {
+    m_uiout->redirect (NULL);
+  }
+
+  ui_out_redirect_pop (const ui_out_redirect_pop &) = delete;
+  ui_out_redirect_pop &operator= (const ui_out_redirect_pop &) = delete;
+
+private:
+  struct ui_out *m_uiout;
+};
+
 #endif /* UI_OUT_H */
This page took 0.028987 seconds and 4 git commands to generate.