[review] Wrap shared windows-nat code in windows_nat namespace
Commit Message
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/416
......................................................................
Wrap shared windows-nat code in windows_nat namespace
This wraps the shared windows-nat code in a windows_nat namespace.
This helps avoid name clashes.
Change-Id: I849284860100a0028e611786e021e95f4bc4b579
gdb/ChangeLog
2019-10-29 Tom Tromey <tromey@adacore.com>
* windows-nat.c: Add "using namespace".
* nat/windows-nat.h: Wrap contents in windows_nat namespace.
* nat/windows-nat.c: Wrap contents in windows_nat namespace.
gdb/gdbserver/ChangeLog
2019-10-29 Tom Tromey <tromey@adacore.com>
* win32-low.h: Add "using namespace".
Change-Id: I56105d1c87a4170377364351dddf9f71be182546
---
M gdb/ChangeLog
M gdb/gdbserver/ChangeLog
M gdb/gdbserver/win32-low.h
M gdb/nat/windows-nat.c
M gdb/nat/windows-nat.h
M gdb/windows-nat.c
6 files changed, 24 insertions(+), 0 deletions(-)
Comments
Luis Machado has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/416
......................................................................
Patch Set 1: Code-Review+1
Looks OK.
@@ -1,5 +1,11 @@
2019-10-29 Tom Tromey <tromey@adacore.com>
+ * windows-nat.c: Add "using namespace".
+ * nat/windows-nat.h: Wrap contents in windows_nat namespace.
+ * nat/windows-nat.c: Wrap contents in windows_nat namespace.
+
+2019-10-29 Tom Tromey <tromey@adacore.com>
+
* nat/windows-nat.h (struct windows_thread_info): Declare
destructor.
* nat/windows-nat.c (~windows_thread_info): New.
@@ -1,5 +1,9 @@
2019-10-29 Tom Tromey <tromey@adacore.com>
+ * win32-low.h: Add "using namespace".
+
+2019-10-29 Tom Tromey <tromey@adacore.com>
+
* win32-low.c (delete_thread_info): Don't call CloseHandle.
2019-10-29 Tom Tromey <tromey@adacore.com>
@@ -22,6 +22,8 @@
#include <windows.h>
#include "nat/windows-nat.h"
+using namespace windows_nat;
+
struct target_desc;
/* The inferior's target description. This is a global because the
@@ -19,6 +19,9 @@
#include "gdbsupport/common-defs.h"
#include "nat/windows-nat.h"
+namespace windows_nat
+{
+
windows_thread_info::~windows_thread_info ()
{
CloseHandle (h);
@@ -63,3 +66,5 @@
}
suspended = 0;
}
+
+}
@@ -21,6 +21,9 @@
#include <windows.h>
+namespace windows_nat
+{
+
/* Thread information structure used to track extra information about
each thread. */
struct windows_thread_info
@@ -77,4 +80,6 @@
gdb::unique_xmalloc_ptr<char> name;
};
+}
+
#endif
@@ -71,6 +71,8 @@
#include "gdbsupport/pathstuff.h"
#include "nat/windows-nat.h"
+using namespace windows_nat;
+
#define AdjustTokenPrivileges dyn_AdjustTokenPrivileges
#define DebugActiveProcessStop dyn_DebugActiveProcessStop
#define DebugBreakProcess dyn_DebugBreakProcess