From: Simon Marchi Date: Fri, 31 May 2024 02:54:06 +0000 (-0400) Subject: gdb: add IWYU export pragams to gdb_curses.h X-Git-Tag: binutils-2_43~497 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a791eef767389b2bf88c67f3361a001677f8caa7;p=thirdparty%2Fbinutils-gdb.git gdb: add IWYU export pragams to gdb_curses.h It seems like gdb_curses.h is included whenever we want to access ncurses functionality, instead of including directly ncurses.h. As a result, clangd often erroneously shows that gdb_curses.h inclusions are unused. By adding those pragmas, clangd (and the include-what-you-use tool) understands that gdb_curses.h is a valid provider for whatever these ncurses.h files provide. Change-Id: Ia8acd761dae1577f7151d5fb558f35514b4e4ea2 Approved-By: Tom Tromey --- diff --git a/gdb/gdb_curses.h b/gdb/gdb_curses.h index c7ee862cd67..8eb2e8c750a 100644 --- a/gdb/gdb_curses.h +++ b/gdb/gdb_curses.h @@ -40,21 +40,21 @@ #define NCURSES_NOMACROS #if defined (HAVE_NCURSESW_NCURSES_H) -#include +#include /* IWYU pragma: export */ #elif defined (HAVE_NCURSES_NCURSES_H) -#include +#include /* IWYU pragma: export */ #elif defined (HAVE_NCURSES_H) -#include +#include /* IWYU pragma: export */ #elif defined (HAVE_CURSESX_H) -#include +#include /* IWYU pragma: export */ #elif defined (HAVE_CURSES_H) -#include +#include /* IWYU pragma: export */ #endif #if defined (HAVE_NCURSES_TERM_H) -#include +#include /* IWYU pragma: export */ #elif defined (HAVE_TERM_H) -#include +#include /* IWYU pragma: export */ #else /* On MinGW, a real termcap library is usually not present. Stub versions of the termcap functions will be built from stub-termcap.c. Readline