]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix darwin-nat.c build
authorTom Tromey <tromey@adacore.com>
Thu, 16 May 2019 16:45:57 +0000 (10:45 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 16 May 2019 16:46:59 +0000 (10:46 -0600)
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.

gdb/ChangeLog
gdb/darwin-nat.c

index 7eb3b9226bfccf76f7895d238dce81073614fecb..cd71dc31922ce1fbec2a9fc45a1e46cb43fe7ec6 100644 (file)
@@ -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
index e3368ce64716cd20c8acba408005b2ca454a9bfb..8282ef27e61168307556ccfa4370a92c9335ee5a 100644 (file)
@@ -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);