]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: add IWYU export pragams to gdb_curses.h
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 31 May 2024 02:54:06 +0000 (22:54 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 8 Jun 2024 02:52:54 +0000 (22:52 -0400)
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 <tom@tromey.com>
gdb/gdb_curses.h

index c7ee862cd672703f5ab6f32f52faf84b1b82b4bc..8eb2e8c750ab797c54a09a5c2d67f3142c3fed1a 100644 (file)
 #define NCURSES_NOMACROS
 
 #if defined (HAVE_NCURSESW_NCURSES_H)
-#include <ncursesw/ncurses.h>
+#include <ncursesw/ncurses.h> /* IWYU pragma: export */
 #elif defined (HAVE_NCURSES_NCURSES_H)
-#include <ncurses/ncurses.h>
+#include <ncurses/ncurses.h> /* IWYU pragma: export */
 #elif defined (HAVE_NCURSES_H)
-#include <ncurses.h>
+#include <ncurses.h> /* IWYU pragma: export */
 #elif defined (HAVE_CURSESX_H)
-#include <cursesX.h>
+#include <cursesX.h> /* IWYU pragma: export */
 #elif defined (HAVE_CURSES_H)
-#include <curses.h>
+#include <curses.h> /* IWYU pragma: export */
 #endif
 
 #if defined (HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
+#include <ncurses/term.h> /* IWYU pragma: export */
 #elif defined (HAVE_TERM_H)
-#include <term.h>
+#include <term.h> /* 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