summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-08-01 22:00:53 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-09-01 20:43:01 +0200
commitd978a824a0817e08c87acec4c22e56351b19c02f (patch)
treefc1d404aa0fc334145bb63102372f809f71ed814
parent479d3f9dfffb69196bff4b4923ed7b6b4f68ebfa (diff)
Add mappings for <bits/struct_stat.h>
struct stat members are implemented through macros and other stuff, which is defined in that headers, so map the header to the same headers that struct stat is mapped. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r--gcc.libc.imp2
-rw-r--r--iwyu_include_picker.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc.libc.imp b/gcc.libc.imp
index 1bbe989..6f0883f 100644
--- a/gcc.libc.imp
+++ b/gcc.libc.imp
@@ -91,6 +91,8 @@
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
{ include: [ "<bits/stropts.h>", private, "<stropts.h>", public ] },
+ { include: [ "<bits/struct_stat.h>", private, "<sys/stat.h>", public ] },
+ { include: [ "<bits/struct_stat.h>", private, "<ftw.h>", public ] },
{ include: [ "<bits/sys_errlist.h>", private, "<stdio.h>", public ] },
{ include: [ "<bits/syscall.h>", private, "<sys/syscall.h>", public ] },
{ include: [ "<bits/sysctl.h>", private, "<sys/sysctl.h>", public ] },
diff --git a/iwyu_include_picker.cc b/iwyu_include_picker.cc
index ef8eb94..97334c0 100644
--- a/iwyu_include_picker.cc
+++ b/iwyu_include_picker.cc
@@ -465,6 +465,8 @@ const IncludeMapEntry libc_include_map[] = {
{ "<bits/string2.h>", kPrivate, "<string.h>", kPublic },
{ "<bits/string3.h>", kPrivate, "<string.h>", kPublic },
{ "<bits/stropts.h>", kPrivate, "<stropts.h>", kPublic },
+ { "<bits/struct_stat.h>", kPrivate, "<sys/stat.h>", kPublic },
+ { "<bits/struct_stat.h>", kPrivate, "<ftw.h>", kPublic },
{ "<bits/sys_errlist.h>", kPrivate, "<stdio.h>", kPublic },
{ "<bits/syscall.h>", kPrivate, "<sys/syscall.h>", kPublic },
{ "<bits/sysctl.h>", kPrivate, "<sys/sysctl.h>", kPublic },