]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Fix Windows build after #include shuffle
authorKévin Le Gouguec <legouguec@adacore.com>
Mon, 20 May 2024 15:22:50 +0000 (17:22 +0200)
committerKévin Le Gouguec <legouguec@adacore.com>
Mon, 20 May 2024 16:47:33 +0000 (18:47 +0200)
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

index 70f955d9797883600376e913e63446fb0d0a3aa7..e4feea15d1fa98dd31684a2c4d1d0f6f4a20d58c 100644 (file)
@@ -41,6 +41,7 @@
 #include <cygwin/version.h>
 #endif
 #include <algorithm>
+#include <atomic>
 #include <vector>
 #include <queue>