From 5a82b8a12b6a9b8167517ab1df1dcdcc4711ffda Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Tue, 17 Mar 2020 14:38:23 +0100 Subject: Namespace the reg class to avoid clashes with OS headers Fix build issues on NetBSD where the reg symbol exists in public headers. regformats/regdef.h:22:8: error: redefinition struct struct reg ^~~ /usr/include/amd64/reg.h:51:8: note: previous definition struct struct reg { ^~~ gdb/ChangeLog: * regformats/regdef.h: Put reg in gdb namespace. gdbserver/ChangeLog: * regcache.cc (find_register_by_number): Update. * tdesc.cc (init_target_desc): Likewise. * tdesc.h (target_desc::reg_defs): Likewise. --- gdb/regformats/regdef.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/regformats/regdef.h') diff --git a/gdb/regformats/regdef.h b/gdb/regformats/regdef.h index 340281e..ed9aeb7 100644 --- a/gdb/regformats/regdef.h +++ b/gdb/regformats/regdef.h @@ -19,6 +19,8 @@ #ifndef REGFORMATS_REGDEF_H #define REGFORMATS_REGDEF_H +namespace gdb { + struct reg { reg (int _offset) @@ -60,4 +62,6 @@ struct reg } }; +} /* namespace gdb */ + #endif /* REGFORMATS_REGDEF_H */ -- cgit v1.1