public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [OB PATCH] gdb: Fix Windows build after #include shuffle
@ 2024-05-20 17:00 Kévin Le Gouguec
  0 siblings, 0 replies; only message in thread
From: Kévin Le Gouguec @ 2024-05-20 17:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kévin Le Gouguec

Without this patch, the build chokes on:

    ../../src/gdb/windows-nat.c:384:21: error: field 'm_debug_event_pending' has incomplete type 'std::atomic<bool>'
      384 |   std::atomic<bool> m_debug_event_pending { false };
          |                     ^~~~~~~~~~~~~~~~~~~~~
    In file included from […gcc tree…]/include/c++/13.2.1/bits/shared_ptr_atomic.h:33,
                     from […gcc tree…]/include/c++/13.2.1/memory:81,
                     from ../../src/gdb/../gdbsupport/gdb_unique_ptr.h:23,
                     from ../../src/gdb/../gdbsupport/common-utils.h:26,
                     from ../../src/gdb/../gdbsupport/common-defs.h:199,
                     from ./../../src/gdb/defs.h:26,
                     from <command-line>:
    […gcc tree…]/include/c++/13.2.1/bits/atomic_base.h:174:12: note: declaration of 'struct std::atomic<bool>'
      174 |     struct atomic;
          |            ^~~~~~
    make.exe[2]: *** [Makefile:1947: windows-nat.o] Error 1

Presumably windows-nat.c relied on objfiles.h including <atomic>,
which was undone in 2024-05-16 "gdb: remove unused includes in
objfiles.{c,h}" (f617661c110).
---
 gdb/windows-nat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 70f955d9797..e4feea15d1f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -41,6 +41,7 @@
 #include <cygwin/version.h>
 #endif
 #include <algorithm>
+#include <atomic>
 #include <vector>
 #include <queue>
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-20 17:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20 17:00 [OB PATCH] gdb: Fix Windows build after #include shuffle Kévin Le Gouguec

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).