public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix darwin-nat.c build
@ 2019-05-16 16:49 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-05-16 16:49 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=61c9c4212daa0be96503b9069da387aebf9cba04
commit 61c9c4212daa0be96503b9069da387aebf9cba04
Author: Tom Tromey <tromey@adacore.com>
Date: Thu May 16 10:45:57 2019 -0600
Fix darwin-nat.c build
John Marshall pointed out that darwin-nat.c fails to build:
CXX darwin-nat.o
../../../binutils-gdb/gdb/darwin-nat.c:1709:8: error: must use 'class' tag to refer to type 'thread_info' in this scope
for (thread_info *it : all_threads ())
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/thread_act.h:240:15: note:
class 'thread_info' is hidden by a non-type declaration of 'thread_info' here
kern_return_t thread_info
Mach has a thread_info() function declared in that header, which darwin-nat.c #includes.
This patch fixes the problem by reintroducing the struct keyword.
gdb/ChangeLog
2019-05-16 Tom Tromey <tromey@adacore.com>
* darwin-nat.c (thread_info_from_private_thread_info): Add struct
keyword to foreach.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/darwin-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7eb3b92..cd71dc3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-05-16 Tom Tromey <tromey@adacore.com>
+
+ * darwin-nat.c (thread_info_from_private_thread_info): Add struct
+ keyword to foreach.
+
2019-05-15 Simon Marchi <simon.marchi@efficios.com>
* linux-thread-db.c (try_thread_db_load_1): Change return type
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index e3368ce..8282ef2 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1706,7 +1706,7 @@ darwin_attach_pid (struct inferior *inf)
static struct thread_info *
thread_info_from_private_thread_info (darwin_thread_info *pti)
{
- for (thread_info *it : all_threads ())
+ for (struct thread_info *it : all_threads ())
{
darwin_thread_info *iter_pti = get_darwin_thread_info (it);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-16 16:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 16:49 [binutils-gdb] Fix darwin-nat.c build Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).