aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-11-25 11:32:32 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-11-25 17:41:33 +0100
commita827003e3052c6d9ee7bdb71518182e9bd76317d (patch)
treec1b6276a2c74bfc1f190f518e7d098c78e99b3b9
parent03b7d35b5485b6a66bcd92027e43c838766bb205 (diff)
downloadrneovim-a827003e3052c6d9ee7bdb71518182e9bd76317d.tar.gz
rneovim-a827003e3052c6d9ee7bdb71518182e9bd76317d.tar.bz2
rneovim-a827003e3052c6d9ee7bdb71518182e9bd76317d.zip
build: rework IWYU mapping files
Create mapping to most of the C spec and some POSIX specific functions. This is more robust than relying files shipped with IWYU.
-rw-r--r--Makefile1
-rw-r--r--cmake.config/iwyu/c99.imp377
-rw-r--r--cmake.config/iwyu/gcc.libc.imp226
-rw-r--r--cmake.config/iwyu/gcc.symbols.imp305
-rw-r--r--cmake.config/iwyu/mapping.imp32
-rw-r--r--cmake.config/iwyu/posix.imp110
-rw-r--r--src/nvim/CMakeLists.txt4
-rw-r--r--src/nvim/api/deprecated.c2
-rw-r--r--src/nvim/api/extmark.c3
-rw-r--r--src/nvim/api/win_config.c2
-rw-r--r--src/nvim/change.c1
-rw-r--r--src/nvim/charset.c1
-rw-r--r--src/nvim/decoration.c8
-rw-r--r--src/nvim/drawline.c2
-rw-r--r--src/nvim/drawscreen.c3
-rw-r--r--src/nvim/eval/funcs.c2
-rw-r--r--src/nvim/eval/vars.c1
-rw-r--r--src/nvim/event/libuv_process.c1
-rw-r--r--src/nvim/event/loop.h1
-rw-r--r--src/nvim/event/multiqueue.c1
-rw-r--r--src/nvim/event/rstream.c1
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/extmark.c3
-rw-r--r--src/nvim/fileio.c1
-rw-r--r--src/nvim/fold.c1
-rw-r--r--src/nvim/input.c1
-rw-r--r--src/nvim/lua/stdlib.c2
-rw-r--r--src/nvim/mbyte.c1
-rw-r--r--src/nvim/move.c2
-rw-r--r--src/nvim/msgpack_rpc/channel.c1
-rw-r--r--src/nvim/option.c1
-rw-r--r--src/nvim/os/fs.c1
-rw-r--r--src/nvim/os/unix_defs.h1
-rw-r--r--src/nvim/plines.c1
-rw-r--r--src/nvim/regexp.c1
-rw-r--r--src/nvim/sign.c8
-rw-r--r--src/nvim/tui/input.c1
-rw-r--r--src/nvim/tui/tui.c1
38 files changed, 541 insertions, 572 deletions
diff --git a/Makefile b/Makefile
index 4b130476f1..50b260d62c 100644
--- a/Makefile
+++ b/Makefile
@@ -141,6 +141,7 @@ iwyu: build/.ran-cmake
cmake --build build > build/iwyu.log
iwyu-fix-includes --only_re="src/nvim" --ignore_re="src/nvim/(auto|map.h|eval/encode.c)" --safe_headers < build/iwyu.log
cmake -B build -U ENABLE_IWYU
+ cmake --build build
clean:
+test -d build && $(BUILD_TOOL) -C build clean || true
diff --git a/cmake.config/iwyu/c99.imp b/cmake.config/iwyu/c99.imp
new file mode 100644
index 0000000000..5f714c88b9
--- /dev/null
+++ b/cmake.config/iwyu/c99.imp
@@ -0,0 +1,377 @@
+# Symbols defined in the C spec.
+# These are taken from https://port70.net/~nsz/c/c99/n1256.html#B
+
+[
+ #B.3 Character handling <ctype.h>
+ { symbol: ["isalnum", private, "<ctype.h>", public ] },
+ { symbol: ["isalpha", private, "<ctype.h>", public ] },
+ { symbol: ["isblank", private, "<ctype.h>", public ] },
+ { symbol: ["iscntrl", private, "<ctype.h>", public ] },
+ { symbol: ["isdigit", private, "<ctype.h>", public ] },
+ { symbol: ["isgraph", private, "<ctype.h>", public ] },
+ { symbol: ["islower", private, "<ctype.h>", public ] },
+ { symbol: ["isprint", private, "<ctype.h>", public ] },
+ { symbol: ["ispunct", private, "<ctype.h>", public ] },
+ { symbol: ["isspace", private, "<ctype.h>", public ] },
+ { symbol: ["isupper", private, "<ctype.h>", public ] },
+ { symbol: ["isxdigi", private, "<ctype.h>", public ] },
+ { symbol: ["tolower", private, "<ctype.h>", public ] },
+ { symbol: ["toupper", private, "<ctype.h>", public ] },
+
+ # B.4 Errors <errno.h>
+ { symbol: ["EDOM", private, "<errno.h>", public ] },
+ { symbol: ["EILSEQ", private, "<errno.h>", public ] },
+ { symbol: ["ERANGE", private, "<errno.h>", public ] },
+ { symbol: ["errno", private, "<errno.h>", public ] },
+
+ # B.10 Localization <locale.h>
+ { symbol: ["lconv", private, "<locale.h>", public ] },
+ { symbol: ["NULL", private, "<locale.h>", public ] },
+ { symbol: ["LC_ALL", private, "<locale.h>", public ] },
+ { symbol: ["LC_COLLATE", private, "<locale.h>", public ] },
+ { symbol: ["LC_CTYPE", private, "<locale.h>", public ] },
+ { symbol: ["LC_MONETARY", private, "<locale.h>", public ] },
+ { symbol: ["LC_NUMERIC", private, "<locale.h>", public ] },
+ { symbol: ["LC_TIME", private, "<locale.h>", public ] },
+ { symbol: ["setlocale", private, "<locale.h>", public ] },
+ { symbol: ["localeconv", private, "<locale.h>", public ] },
+
+ # B.14 Variable arguments <stdarg.h>
+ { symbol: ["va_list", private, "<stdarg.h>", public ] },
+ { symbol: ["va_arg", private, "<stdarg.h>", public ] },
+ { symbol: ["va_copy", private, "<stdarg.h>", public ] },
+ { symbol: ["va_end", private, "<stdarg.h>", public ] },
+ { symbol: ["va_start", private, "<stdarg.h>", public ] },
+
+ # B.16 Common definitions <stddef.h>
+ { symbol: ["ptrdiff_t", private, "<stddef.h>", public ] },
+ { symbol: ["size_t", private, "<stddef.h>", public ] },
+ { symbol: ["wchar_t", private, "<stddef.h>", public ] },
+ { symbol: ["NULL", private, "<stddef.h>", public ] },
+ { symbol: ["offsetof", private, "<stddef.h>", public ] },
+
+ # B.17 Integer types <stdint.h>
+ { symbol: ["int8_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint8_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_least8_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_least8_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_fast8_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_fast8_t", private, "<stdint.h>", public ] },
+ { symbol: ["INT8_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST8_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_LEAST8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST8_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_FAST8_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT8_C", private, "<stdint.h>", public ] },
+ { symbol: ["UINT8_C", private, "<stdint.h>", public ] },
+ { symbol: ["int16_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint16_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_least16_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_least16_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_fast16_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_fast16_t", private, "<stdint.h>", public ] },
+ { symbol: ["INT16_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST16_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_LEAST16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST16_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_FAST16_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT16_C", private, "<stdint.h>", public ] },
+ { symbol: ["UINT16_C", private, "<stdint.h>", public ] },
+ { symbol: ["int32_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint32_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_least32_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_least32_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_fast32_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_fast32_t", private, "<stdint.h>", public ] },
+ { symbol: ["INT32_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST32_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_LEAST32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST32_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_FAST32_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT32_C", private, "<stdint.h>", public ] },
+ { symbol: ["UINT32_C", private, "<stdint.h>", public ] },
+ { symbol: ["int64_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint64_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_least64_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_least64_t", private, "<stdint.h>", public ] },
+ { symbol: ["int_fast64_t", private, "<stdint.h>", public ] },
+ { symbol: ["uint_fast64_t", private, "<stdint.h>", public ] },
+ { symbol: ["INT64_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST64_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_LEAST64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_LEAST64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST64_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INT_FAST64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINT_FAST64_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INT64_C", private, "<stdint.h>", public ] },
+ { symbol: ["UINT64_C", private, "<stdint.h>", public ] },
+ { symbol: ["intptr_t", private, "<stdint.h>", public ] },
+ { symbol: ["uintptr_t", private, "<stdint.h>", public ] },
+ { symbol: ["intmax_t", private, "<stdint.h>", public ] },
+ { symbol: ["uintmax_t", private, "<stdint.h>", public ] },
+ { symbol: ["INTPTR_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INTPTR_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINTPTR_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INTMAX_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["INTMAX_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["UINTMAX_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["PTRDIFF_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["PTRDIFF_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["SIG_ATOMIC_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["SIG_ATOMIC_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["SIZE_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["WCHAR_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["WCHAR_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["WINT_MIN", private, "<stdint.h>", public ] },
+ { symbol: ["WINT_MAX", private, "<stdint.h>", public ] },
+ { symbol: ["INTMAX_C", private, "<stdint.h>", public ] },
+ { symbol: ["UINTMAX_C", private, "<stdint.h>", public ] },
+
+ # B.18 Input/output <stdio.h>
+ { symbol: ["size_t", private, "<stdio.h>", public ] },
+ { symbol: ["FILE", private, "<stdio.h>", public ] },
+ { symbol: ["fpos_t", private, "<stdio.h>", public ] },
+ { symbol: ["NULL", private, "<stdio.h>", public ] },
+ { symbol: ["_IOFBF", private, "<stdio.h>", public ] },
+ { symbol: ["_IOLBF", private, "<stdio.h>", public ] },
+ { symbol: ["_IONBF", private, "<stdio.h>", public ] },
+ { symbol: ["BUFSIZ", private, "<stdio.h>", public ] },
+ { symbol: ["EOF", private, "<stdio.h>", public ] },
+ { symbol: ["FOPEN_MAX", private, "<stdio.h>", public ] },
+ { symbol: ["FILENAME_MAX", private, "<stdio.h>", public ] },
+ { symbol: ["L_tmpnam", private, "<stdio.h>", public ] },
+ { symbol: ["SEEK_CUR", private, "<stdio.h>", public ] },
+ { symbol: ["SEEK_END", private, "<stdio.h>", public ] },
+ { symbol: ["SEEK_SET", private, "<stdio.h>", public ] },
+ { symbol: ["TMP_MAX", private, "<stdio.h>", public ] },
+ { symbol: ["stderr", private, "<stdio.h>", public ] },
+ { symbol: ["stdin", private, "<stdio.h>", public ] },
+ { symbol: ["stdout", private, "<stdio.h>", public ] },
+ { symbol: ["remove", private, "<stdio.h>", public ] },
+ { symbol: ["rename", private, "<stdio.h>", public ] },
+ { symbol: ["tmpfile", private, "<stdio.h>", public ] },
+ { symbol: ["tmpnam", private, "<stdio.h>", public ] },
+ { symbol: ["fclose", private, "<stdio.h>", public ] },
+ { symbol: ["fflush", private, "<stdio.h>", public ] },
+ { symbol: ["fopen", private, "<stdio.h>", public ] },
+ { symbol: ["freopen", private, "<stdio.h>", public ] },
+ { symbol: ["setbuf", private, "<stdio.h>", public ] },
+ { symbol: ["setvbuf", private, "<stdio.h>", public ] },
+ { symbol: ["fprintf", private, "<stdio.h>", public ] },
+ { symbol: ["fscanf", private, "<stdio.h>", public ] },
+ { symbol: ["printf", private, "<stdio.h>", public ] },
+ { symbol: ["scanf", private, "<stdio.h>", public ] },
+ { symbol: ["snprintf", private, "<stdio.h>", public ] },
+ { symbol: ["sprintf", private, "<stdio.h>", public ] },
+ { symbol: ["sscanf", private, "<stdio.h>", public ] },
+ { symbol: ["vfprintf", private, "<stdio.h>", public ] },
+ { symbol: ["vfscanf", private, "<stdio.h>", public ] },
+ { symbol: ["vprintf", private, "<stdio.h>", public ] },
+ { symbol: ["vscanf", private, "<stdio.h>", public ] },
+ { symbol: ["vsnprintf", private, "<stdio.h>", public ] },
+ { symbol: ["vsprintf", private, "<stdio.h>", public ] },
+ { symbol: ["vsscanf", private, "<stdio.h>", public ] },
+ { symbol: ["fgetc", private, "<stdio.h>", public ] },
+ { symbol: ["fgets", private, "<stdio.h>", public ] },
+ { symbol: ["fputc", private, "<stdio.h>", public ] },
+ { symbol: ["fputs", private, "<stdio.h>", public ] },
+ { symbol: ["getc", private, "<stdio.h>", public ] },
+ { symbol: ["getchar", private, "<stdio.h>", public ] },
+ { symbol: ["gets", private, "<stdio.h>", public ] },
+ { symbol: ["putc", private, "<stdio.h>", public ] },
+ { symbol: ["putchar", private, "<stdio.h>", public ] },
+ { symbol: ["puts", private, "<stdio.h>", public ] },
+ { symbol: ["ungetc", private, "<stdio.h>", public ] },
+ { symbol: ["fread", private, "<stdio.h>", public ] },
+ { symbol: ["fwrite", private, "<stdio.h>", public ] },
+ { symbol: ["fgetpos", private, "<stdio.h>", public ] },
+ { symbol: ["fseek", private, "<stdio.h>", public ] },
+ { symbol: ["fsetpos", private, "<stdio.h>", public ] },
+ { symbol: ["ftell", private, "<stdio.h>", public ] },
+ { symbol: ["rewind", private, "<stdio.h>", public ] },
+ { symbol: ["clearerr", private, "<stdio.h>", public ] },
+ { symbol: ["feof", private, "<stdio.h>", public ] },
+ { symbol: ["ferror", private, "<stdio.h>", public ] },
+ { symbol: ["perror", private, "<stdio.h>", public ] },
+
+ # B.19 General utilities <stdlib.h>
+ { symbol: ["size_t", private, "<stdlib.h>", public ] },
+ { symbol: ["wchar_t", private, "<stdlib.h>", public ] },
+ { symbol: ["div_t", private, "<stdlib.h>", public ] },
+ { symbol: ["ldiv_t", private, "<stdlib.h>", public ] },
+ { symbol: ["lldiv_t", private, "<stdlib.h>", public ] },
+ { symbol: ["NULL", private, "<stdlib.h>", public ] },
+ { symbol: ["EXIT_FAILURE", private, "<stdlib.h>", public ] },
+ { symbol: ["EXIT_SUCCESS", private, "<stdlib.h>", public ] },
+ { symbol: ["RAND_MAX", private, "<stdlib.h>", public ] },
+ { symbol: ["MB_CUR_MAX", private, "<stdlib.h>", public ] },
+ { symbol: ["atof", private, "<stdlib.h>", public ] },
+ { symbol: ["atoi", private, "<stdlib.h>", public ] },
+ { symbol: ["atol", private, "<stdlib.h>", public ] },
+ { symbol: ["atoll", private, "<stdlib.h>", public ] },
+ { symbol: ["strtod", private, "<stdlib.h>", public ] },
+ { symbol: ["strtof", private, "<stdlib.h>", public ] },
+ { symbol: ["strtold", private, "<stdlib.h>", public ] },
+ { symbol: ["strtol", private, "<stdlib.h>", public ] },
+ { symbol: ["strtoll", private, "<stdlib.h>", public ] },
+ { symbol: ["strtoul", private, "<stdlib.h>", public ] },
+ { symbol: ["strtoull", private, "<stdlib.h>", public ] },
+ { symbol: ["rand", private, "<stdlib.h>", public ] },
+ { symbol: ["srand", private, "<stdlib.h>", public ] },
+ { symbol: ["calloc", private, "<stdlib.h>", public ] },
+ { symbol: ["free", private, "<stdlib.h>", public ] },
+ { symbol: ["malloc", private, "<stdlib.h>", public ] },
+ { symbol: ["realloc", private, "<stdlib.h>", public ] },
+ { symbol: ["abort", private, "<stdlib.h>", public ] },
+ { symbol: ["atexit", private, "<stdlib.h>", public ] },
+ { symbol: ["exit", private, "<stdlib.h>", public ] },
+ { symbol: ["_Exit", private, "<stdlib.h>", public ] },
+ { symbol: ["getenv", private, "<stdlib.h>", public ] },
+ { symbol: ["system", private, "<stdlib.h>", public ] },
+ { symbol: ["bsearch", private, "<stdlib.h>", public ] },
+ { symbol: ["qsort", private, "<stdlib.h>", public ] },
+ { symbol: ["abs", private, "<stdlib.h>", public ] },
+ { symbol: ["labs", private, "<stdlib.h>", public ] },
+ { symbol: ["llabs", private, "<stdlib.h>", public ] },
+ { symbol: ["div", private, "<stdlib.h>", public ] },
+ { symbol: ["ldiv", private, "<stdlib.h>", public ] },
+ { symbol: ["lldiv", private, "<stdlib.h>", public ] },
+ { symbol: ["mblen", private, "<stdlib.h>", public ] },
+ { symbol: ["mbtowc", private, "<stdlib.h>", public ] },
+ { symbol: ["wctomb", private, "<stdlib.h>", public ] },
+ { symbol: ["mbstowcs", private, "<stdlib.h>", public ] },
+ { symbol: ["wcstombs", private, "<stdlib.h>", public ] },
+
+ # B.20 String handling <string.h>
+ { symbol: ["size_t", private, "<string.h>", public ] },
+ { symbol: ["NULL", private, "<string.h>", public ] },
+ { symbol: ["memcpy", private, "<string.h>", public ] },
+ { symbol: ["memmove", private, "<string.h>", public ] },
+ { symbol: ["strcpy", private, "<string.h>", public ] },
+ { symbol: ["strncpy", private, "<string.h>", public ] },
+ { symbol: ["strcat", private, "<string.h>", public ] },
+ { symbol: ["strncat", private, "<string.h>", public ] },
+ { symbol: ["memcmp", private, "<string.h>", public ] },
+ { symbol: ["strcmp", private, "<string.h>", public ] },
+ { symbol: ["strcoll", private, "<string.h>", public ] },
+ { symbol: ["strncmp", private, "<string.h>", public ] },
+ { symbol: ["strxfrm", private, "<string.h>", public ] },
+ { symbol: ["memchr", private, "<string.h>", public ] },
+ { symbol: ["strchr", private, "<string.h>", public ] },
+ { symbol: ["strcspn", private, "<string.h>", public ] },
+ { symbol: ["strpbrk", private, "<string.h>", public ] },
+ { symbol: ["strrchr", private, "<string.h>", public ] },
+ { symbol: ["strspn", private, "<string.h>", public ] },
+ { symbol: ["strstr", private, "<string.h>", public ] },
+ { symbol: ["strtok", private, "<string.h>", public ] },
+ { symbol: ["memset", private, "<string.h>", public ] },
+ { symbol: ["strerror", private, "<string.h>", public ] },
+ { symbol: ["strlen", private, "<string.h>", public ] },
+
+ # B.22 Date and time <time.h>
+ { symbol: ["NULL", private, "<time.h>", public ] },
+ { symbol: ["CLOCKS_PER_SEC", private, "<time.h>", public ] },
+ { symbol: ["size_t", private, "<time.h>", public ] },
+ { symbol: ["clock_t", private, "<time.h>", public ] },
+ { symbol: ["time_t", private, "<time.h>", public ] },
+ { symbol: ["tm", private, "<time.h>", public ] },
+ { symbol: ["clock", private, "<time.h>", public ] },
+ { symbol: ["difftime", private, "<time.h>", public ] },
+ { symbol: ["mktime", private, "<time.h>", public ] },
+ { symbol: ["time", private, "<time.h>", public ] },
+ { symbol: ["asctime", private, "<time.h>", public ] },
+ { symbol: ["ctime", private, "<time.h>", public ] },
+ { symbol: ["gmtime", private, "<time.h>", public ] },
+ { symbol: ["localtime", private, "<time.h>", public ] },
+ { symbol: ["strftime", private, "<time.h>", public ] },
+
+ # B.23 Extended multibyte/wide character utilities <wchar.h>
+ { symbol: ["wchar_t", private, "<wchar.h>", public ] },
+ { symbol: ["wint_t", private, "<wchar.h>", public ] },
+ { symbol: ["WCHAR_MAX", private, "<wchar.h>", public ] },
+ { symbol: ["size_t", private, "<wchar.h>", public ] },
+ { symbol: ["tm", private, "<wchar.h>", public ] },
+ { symbol: ["WCHAR_MIN", private, "<wchar.h>", public ] },
+ { symbol: ["mbstate_t", private, "<wchar.h>", public ] },
+ { symbol: ["NULL", private, "<wchar.h>", public ] },
+ { symbol: ["WEOF", private, "<wchar.h>", public ] },
+ { symbol: ["fwprintf", private, "<wchar.h>", public ] },
+ { symbol: ["fwscanf", private, "<wchar.h>", public ] },
+ { symbol: ["swprintf", private, "<wchar.h>", public ] },
+ { symbol: ["swscanf", private, "<wchar.h>", public ] },
+ { symbol: ["vfwprintf", private, "<wchar.h>", public ] },
+ { symbol: ["vfwscanf", private, "<wchar.h>", public ] },
+ { symbol: ["vswprintf", private, "<wchar.h>", public ] },
+ { symbol: ["vswscanf", private, "<wchar.h>", public ] },
+ { symbol: ["vwprintf", private, "<wchar.h>", public ] },
+ { symbol: ["vwscanf", private, "<wchar.h>", public ] },
+ { symbol: ["wprintf", private, "<wchar.h>", public ] },
+ { symbol: ["wscanf", private, "<wchar.h>", public ] },
+ { symbol: ["fgetwc", private, "<wchar.h>", public ] },
+ { symbol: ["fgetws", private, "<wchar.h>", public ] },
+ { symbol: ["fputwc", private, "<wchar.h>", public ] },
+ { symbol: ["fputws", private, "<wchar.h>", public ] },
+ { symbol: ["fwide", private, "<wchar.h>", public ] },
+ { symbol: ["getwc", private, "<wchar.h>", public ] },
+ { symbol: ["getwchar", private, "<wchar.h>", public ] },
+ { symbol: ["putwc", private, "<wchar.h>", public ] },
+ { symbol: ["putwchar", private, "<wchar.h>", public ] },
+ { symbol: ["ungetwc", private, "<wchar.h>", public ] },
+ { symbol: ["wcstod", private, "<wchar.h>", public ] },
+ { symbol: ["wcstof", private, "<wchar.h>", public ] },
+ { symbol: ["wcstold", private, "<wchar.h>", public ] },
+ { symbol: ["wcstol", private, "<wchar.h>", public ] },
+ { symbol: ["wcstoll", private, "<wchar.h>", public ] },
+ { symbol: ["wcstoul", private, "<wchar.h>", public ] },
+ { symbol: ["wcstoull", private, "<wchar.h>", public ] },
+ { symbol: ["wcscpy", private, "<wchar.h>", public ] },
+ { symbol: ["wcsncpy", private, "<wchar.h>", public ] },
+ { symbol: ["wmemcpy", private, "<wchar.h>", public ] },
+ { symbol: ["wmemmove", private, "<wchar.h>", public ] },
+ { symbol: ["wcscat", private, "<wchar.h>", public ] },
+ { symbol: ["wcsncat", private, "<wchar.h>", public ] },
+ { symbol: ["wcscmp", private, "<wchar.h>", public ] },
+ { symbol: ["wcscoll", private, "<wchar.h>", public ] },
+ { symbol: ["wcsncmp", private, "<wchar.h>", public ] },
+ { symbol: ["wcsxfrm", private, "<wchar.h>", public ] },
+ { symbol: ["wmemcmp", private, "<wchar.h>", public ] },
+ { symbol: ["wcschr", private, "<wchar.h>", public ] },
+ { symbol: ["wcscspn", private, "<wchar.h>", public ] },
+ { symbol: ["wcspbrk", private, "<wchar.h>", public ] },
+ { symbol: ["wcsrchr", private, "<wchar.h>", public ] },
+ { symbol: ["wcsspn", private, "<wchar.h>", public ] },
+ { symbol: ["wcsstr", private, "<wchar.h>", public ] },
+ { symbol: ["wcstok", private, "<wchar.h>", public ] },
+ { symbol: ["wmemchr", private, "<wchar.h>", public ] },
+ { symbol: ["wcslen", private, "<wchar.h>", public ] },
+ { symbol: ["wmemset", private, "<wchar.h>", public ] },
+ { symbol: ["wcsftime", private, "<wchar.h>", public ] },
+ { symbol: ["btowc", private, "<wchar.h>", public ] },
+ { symbol: ["wctob", private, "<wchar.h>", public ] },
+ { symbol: ["mbsinit", private, "<wchar.h>", public ] },
+ { symbol: ["mbrlen", private, "<wchar.h>", public ] },
+ { symbol: ["mbrtowc", private, "<wchar.h>", public ] },
+ { symbol: ["wcrtomb", private, "<wchar.h>", public ] },
+ { symbol: ["mbsrtowcs", private, "<wchar.h>", public ] },
+ { symbol: ["wcsrtombs", private, "<wchar.h>", public ] },
+
+ # inttypes.h includes stdint.h
+ # https://port70.net/~nsz/c/c99/n1256.html#7.8p1
+ { include: [ "<stdint.h>", public, "<inttypes.h>", public ] },
+]
+
+# vim: set ft=toml:
diff --git a/cmake.config/iwyu/gcc.libc.imp b/cmake.config/iwyu/gcc.libc.imp
deleted file mode 100644
index 1dd0ad42c7..0000000000
--- a/cmake.config/iwyu/gcc.libc.imp
+++ /dev/null
@@ -1,226 +0,0 @@
-# This was initially taken from the IWYU repository:
-# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.libc.imp
-# It has useful mappings that are normally enabled by default, but there are
-# other default mappings that conflict with our builds. The best solution seems
-# to be to disable all defaults, import the defaults from the IWYU
-# repo and modify the rules that conflict with our build.
-#
-# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
-# to avoid this file entirely.
-
-# Mappings for GNU libc
-# ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { include: [ "<$2>", private, "<$1>", public ] },@' | grep bits/ | sort )
-# When I saw more than one mapping for these, I typically picked
-# what I thought was the "best" one.
-[
- { include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
- { include: [ "<bits/auxv.h>", private, "<sys/auxv.h>", public ] },
- { include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
- { include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
- { include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
- { include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
- { include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
- { include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
- { include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
- { include: [ "<bits/environments.h>", private, "<unistd.h>", private ] },
- { include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
- { include: [ "<bits/errno.h>", private, "<errno.h>", public ] },
- { include: [ "<bits/error.h>", private, "<error.h>", public ] },
- { include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
- { include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
- { include: [ "<bits/fcntl2.h>", private, "<fcntl.h>", public ] },
- { include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
- { include: [ "<bits/fenvinline.h>", private, "<fenv.h>", public ] },
- { include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
- { include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
- { include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
- { include: [ "<bits/hwcap.h>", private, "<sys/auxv.h>", public ] },
- { include: [ "<bits/inf.h>", private, "<math.h>", public ] },
- { include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
- { include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
- { include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
- { include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
- { include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
- { include: [ "<bits/libio-ldbl.h>", private, "<libio.h>", public ] },
- { include: [ "<bits/link.h>", private, "<link.h>", public ] },
- { include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
- { include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mathcalls.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
- { include: [ "<bits/mman-shared.h>", private, "<sys/mman.h>", public ] },
- { include: [ "<bits/monetary-ldbl.h>", private, "<monetary.h>", public ] },
- { include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
- { include: [ "<bits/mqueue2.h>", private, "<mqueue.h>", public ] },
- { include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
- { include: [ "<bits/nan.h>", private, "<math.h>", public ] },
- { include: [ "<bits/netdb.h>", private, "<netdb.h>", private ] },
- { include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
- { include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
- { include: [ "<bits/poll2.h>", private, "<sys/poll.h>", private ] },
- { include: [ "<bits/posix1_lim.h>", private, "<limits.h>", public ] },
- { include: [ "<bits/posix2_lim.h>", private, "<limits.h>", public ] },
- { include: [ "<bits/posix_opt.h>", private, "<unistd.h>", private ] },
- { include: [ "<bits/printf-ldbl.h>", private, "<printf.h>", public ] },
- { include: [ "<bits/pthreadtypes.h>", private, "<pthread.h>", private ] },
- { include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
- { include: [ "<bits/sched.h>", private, "<sched.h>", public ] },
- { include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
- { include: [ "<bits/select2.h>", private, "<sys/select.h>", public ] },
- { include: [ "<bits/sem.h>", private, "<sys/sem.h>", public ] },
- { include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
- { include: [ "<bits/setjmp.h>", private, "<setjmp.h>", public ] },
- { include: [ "<bits/setjmp2.h>", private, "<setjmp.h>", public ] },
- { include: [ "<bits/shm.h>", private, "<sys/shm.h>", public ] },
- { include: [ "<bits/sigaction.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/siginfo.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/signum.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/sigset.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/sigstack.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/sigthread.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/sockaddr.h>", private, "<sys/un.h>", public ] },
- { include: [ "<bits/socket.h>", private, "<sys/socket.h>", private ] },
- { include: [ "<bits/socket2.h>", private, "<sys/socket.h>", private ] },
- { include: [ "<bits/socket_type.h>", private, "<sys/socket.h>", private ] },
- { include: [ "<bits/stab.def>", private, "<stab.h>", public ] },
- { include: [ "<bits/stat.h>", private, "<sys/stat.h>", public ] },
- { include: [ "<bits/statfs.h>", private, "<sys/statfs.h>", public ] },
- { include: [ "<bits/statvfs.h>", private, "<sys/statvfs.h>", public ] },
- { include: [ "<bits/stdio-ldbl.h>", private, "<stdio.h>", public ] },
- { include: [ "<bits/stdio-lock.h>", private, "<libio.h>", public ] },
- { include: [ "<bits/stdio.h>", private, "<stdio.h>", public ] },
- { include: [ "<bits/stdio2.h>", private, "<stdio.h>", public ] },
- { include: [ "<bits/stdio_lim.h>", private, "<stdio.h>", public ] },
- { include: [ "<bits/stdlib-bsearch.h>", private, "<stdlib.h>", public ] },
- { include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
- { include: [ "<bits/stdlib-ldbl.h>", private, "<stdlib.h>", public ] },
- { include: [ "<bits/stdlib.h>", private, "<stdlib.h>", public ] },
- { include: [ "<bits/string.h>", private, "<string.h>", public ] },
- { 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 ] },
- { include: [ "<bits/syslog-ldbl.h>", private, "<sys/syslog.h>", private ] },
- { include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] },
- { include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] },
- { include: [ "<bits/termios.h>", private, "<termios.h>", private ] },
- { include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", private ] },
- { include: [ "<bits/termios-struct.h>", private, "<termios.h>", private ] },
- { include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", private ] },
- { include: [ "<bits/time.h>", private, "<time.h>", public ] },
- { include: [ "<bits/time.h>", private, "<sys/time.h>", public ] },
- { include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
- { include: [ "<bits/timex.h>", private, "<sys/timex.h>", public ] },
- { include: [ "<bits/types.h>", private, "<sys/types.h>", public ] },
- { include: [ "<bits/types/siginfo_t.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/types/siginfo_t.h>", private, "<sys/wait.h>", public ] },
- { include: [ "<bits/uio.h>", private, "<sys/uio.h>", public ] },
- { include: [ "<bits/unistd.h>", private, "<unistd.h>", private ] },
- { include: [ "<bits/ustat.h>", private, "<sys/ustat.h>", private ] },
- { include: [ "<bits/utmp.h>", private, "<utmp.h>", public ] },
- { include: [ "<bits/utmpx.h>", private, "<utmpx.h>", public ] },
- { include: [ "<bits/utsname.h>", private, "<sys/utsname.h>", public ] },
- { include: [ "<bits/waitflags.h>", private, "<sys/wait.h>", public ] },
- { include: [ "<bits/waitstatus.h>", private, "<sys/wait.h>", public ] },
- { include: [ "<bits/wchar-ldbl.h>", private, "<wchar.h>", public ] },
- { include: [ "<bits/wchar.h>", private, "<wchar.h>", public ] },
- { include: [ "<bits/wchar2.h>", private, "<wchar.h>", public ] },
- { include: [ "<bits/wordsize.h>", private, "<limits.h>", public ] },
- { include: [ "<bits/xopen_lim.h>", private, "<limits.h>", public ] },
- { include: [ "<bits/xtitypes.h>", private, "<stropts.h>", public ] },
- # Sometimes libc tells you what mapping to do via an '#error':
- # # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
- # or
- # # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
- # ( cd /usr/include && grep -R '^ *# *error "Never use\|include' * | perl -nle 'm/<([^>]+).*directly.*<([^>]+)/ && print qq@ { include: [ "<$1>", private, "<$2>", public ] },@' | sort )
- { include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
- { include: [ "<bits/byteswap-16.h>", private, "<byteswap.h>", public ] },
- { include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
- { include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
- { include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
- { include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
- { include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
- { include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
- { include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
- { include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
- { include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
- { include: [ "<bits/fcntl-linux.h>", private, "<fcntl.h>", public ] },
- { include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
- { include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
- { include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
- { include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
- { include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
- { include: [ "<bits/in.h>", private, "<netinet/in.h>", private ] },
- { include: [ "<bits/inf.h>", private, "<math.h>", public ] },
- { include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
- { include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
- { include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
- { include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
- { include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
- { include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
- { include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
- { include: [ "<bits/mman-linux.h>", private, "<sys/mman.h>", public ] },
- { include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
- { include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
- { include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
- { include: [ "<bits/nan.h>", private, "<math.h>", public ] },
- { include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
- { include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
- { include: [ "<bits/predefs.h>", private, "<features.h>", public ] },
- { include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
- { include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
- { include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
- { include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
- { include: [ "<bits/signalfd.h>", private, "<sys/signalfd.h>", public ] },
- { include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
- { include: [ "<bits/string.h>", private, "<string.h>", public ] },
- { include: [ "<bits/string2.h>", private, "<string.h>", public ] },
- { include: [ "<bits/string3.h>", private, "<string.h>", public ] },
- { include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
- { include: [ "<bits/typesizes.h>", private, "<sys/types.h>", public ] },
- # Top-level #includes that just forward to another file:
- # $ for i in /usr/include/*; do [ -f $i ] } && [ `wc -l < $i` = 1 ] } && echo $i; done
- # (poll.h, syscall.h, syslog.h, ustat.h, wait.h).
- # For each file, I looked at the list of canonical header files --
- # http://www.opengroup.org/onlinepubs/9699919799/idx/head.html --
- # to decide which of the two files is canonical. If neither is
- # on the POSIX.1 1998 list, I just choose the top-level one.
- { include: [ "<sys/poll.h>", private, "<poll.h>", public ] },
- { include: [ "<sys/syslog.h>", private, "<syslog.h>", public ] },
- { include: [ "<sys/ustat.h>", private, "<ustat.h>", public ] },
- { include: [ "<wait.h>", private, "<sys/wait.h>", public ] },
- # These are all files in bits/ that delegate to asm/ and linux/ to
- # do all (or lots) of the work. Note these are private->private.
- # $ for i in /usr/include/bits/*; do for dir in asm linux; do grep -H -e $dir/`basename $i` $i; done; done
- { include: [ "<linux/errno.h>", private, "<bits/errno.h>", private ] },
- { include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
- { include: [ "<asm/socket.h>", private, "<bits/socket.h>", private ] },
- { include: [ "<linux/socket.h>", private, "<bits/socket.h>", private ] },
- # Some asm files have 32- and 64-bit variants:
- # $ ls /usr/include/asm/*_{32,64}.h
- { include: [ "<asm/posix_types_32.h>", private, "<asm/posix_types.h>", public ] },
- { include: [ "<asm/posix_types_64.h>", private, "<asm/posix_types.h>", public ] },
- { include: [ "<asm/unistd_32.h>", private, "<asm/unistd.h>", private ] },
- { include: [ "<asm/unistd_64.h>", private, "<asm/unistd.h>", private ] },
- # I don't know what grep would have found these. I found them
- # via user report.
- { include: [ "<asm/errno.h>", private, "<errno.h>", public ] },
- { include: [ "<asm/errno-base.h>", private, "<errno.h>", public ] },
- { include: [ "<asm/ptrace-abi.h>", private, "<asm/ptrace.h>", public ] },
- { include: [ "<asm/unistd.h>", private, "<sys/syscall.h>", public ] },
- { include: [ "<linux/limits.h>", private, "<limits.h>", public ] }, # PATH_MAX
- { include: [ "<linux/prctl.h>", private, "<sys/prctl.h>", public ] },
- { include: [ "<sys/ucontext.h>", private, "<ucontext.h>", public ] },
- # Exports guaranteed by the C standard
- { include: [ "<stdint.h>", public, "<inttypes.h>", public ] },
-]
-
-# vim: set ft=toml:
diff --git a/cmake.config/iwyu/gcc.symbols.imp b/cmake.config/iwyu/gcc.symbols.imp
deleted file mode 100644
index 6066de9d09..0000000000
--- a/cmake.config/iwyu/gcc.symbols.imp
+++ /dev/null
@@ -1,305 +0,0 @@
-# This was initially taken from the IWYU repository:
-# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.symbols.imp
-# It has useful mappings that are normally enabled by default, but there are
-# other default mappings that conflict with our builds. The best solution seems
-# to be to disable all defaults, import the defaults from the IWYU repo and
-# modify the rules that conflict with our build.
-#
-# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
-# to avoid this file entirely.
-
-# For library symbols that can be defined in more than one header
-# file, maps from symbol-name to legitimate header files.
-# This list was generated via
-# grep -R '__.*_defined' /usr/include | perl -nle 'm,/usr/include/([^:]*):#\s*\S+ __(.*)_defined, and print qq@ { symbol: [ "$2", public, "<$1>", public ] },@' | sort -u
-# I ignored all entries that only appeared once on the list (eg uint32_t).
-# I then added in NULL, which according to [diff.null] C.2.2.3, can
-# be defined in <clocale>, <cstddef>, <cstdio>, <cstdlib>,
-# <cstring>, <ctime>, or <cwchar>. We also allow their C
-# equivalents.
-# In each case, I ordered them so <sys/types.h> was first, if it was
-# an option for this type. That's the preferred #include all else
-# equal. The same goes for <stdint.h>. The visibility on the
-# symbol-name is ignored; by convention we always set it to private.
-[
- { symbol: [ "aiocb", private, "<aio.h>", public ] },
- { symbol: [ "blkcnt_t", private, "<sys/types.h>", public ] },
- { symbol: [ "blkcnt_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "blksize_t", private, "<sys/types.h>", public ] },
- { symbol: [ "blksize_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "cc_t", private, "<termios.h>", private ] },
- { symbol: [ "clock_t", private, "<sys/types.h>", public ] },
- { symbol: [ "clock_t", private, "<sys/time.h>", public ] },
- { symbol: [ "clock_t", private, "<time.h>", public ] },
- { symbol: [ "clockid_t", private, "<sys/types.h>", public ] },
- { symbol: [ "clockid_t", private, "<time.h>", public ] },
- { symbol: [ "daddr_t", private, "<sys/types.h>", public ] },
- { symbol: [ "daddr_t", private, "<rpc/types.h>", public ] },
- { symbol: [ "dev_t", private, "<sys/types.h>", public ] },
- { symbol: [ "dev_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "div_t", private, "<stdlib.h>", public ] },
- { symbol: [ "double_t", private, "<math.h>", public ] },
- { symbol: [ "error_t", private, "<errno.h>", public ] },
- { symbol: [ "error_t", private, "<argp.h>", public ] },
- { symbol: [ "error_t", private, "<argz.h>", public ] },
- { symbol: [ "fd_set", private, "<sys/select.h>", public ] },
- { symbol: [ "fd_set", private, "<sys/time.h>", public ] },
- { symbol: [ "fenv_t", private, "<fenv.h>", public ] },
- { symbol: [ "fexcept_t", private, "<fenv.h>", public ] },
- { symbol: [ "FILE", private, "<stdio.h>", public ] },
- { symbol: [ "FILE", private, "<wchar.h>", public ] },
- { symbol: [ "float_t", private, "<math.h>", public ] },
- { symbol: [ "fsblkcnt_t", private, "<sys/types.h>", public ] },
- { symbol: [ "fsblkcnt_t", private, "<sys/statvfs.h>", public ] },
- { symbol: [ "fsfilcnt_t", private, "<sys/types.h>", public ] },
- { symbol: [ "fsfilcnt_t", private, "<sys/statvfs.h>", public ] },
- { symbol: [ "getopt", private, "<unistd.h>", private ] },
- { symbol: [ "gid_t", private, "<sys/types.h>", public ] },
- { symbol: [ "gid_t", private, "<grp.h>", public ] },
- { symbol: [ "gid_t", private, "<pwd.h>", public ] },
- { symbol: [ "gid_t", private, "<signal.h>", public ] },
- { symbol: [ "gid_t", private, "<stropts.h>", public ] },
- { symbol: [ "gid_t", private, "<sys/ipc.h>", public ] },
- { symbol: [ "gid_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "gid_t", private, "<unistd.h>", private ] },
- { symbol: [ "htonl", private, "<arpa/inet.h>", private ] },
- { symbol: [ "htons", private, "<arpa/inet.h>", private ] },
- { symbol: [ "id_t", private, "<sys/types.h>", public ] },
- { symbol: [ "id_t", private, "<sys/resource.h>", public ] },
- { symbol: [ "imaxdiv_t", private, "<inttypes.h>", public ] },
- { symbol: [ "intmax_t", private, "<stdint.h>", public ] },
- { symbol: [ "uintmax_t", private, "<stdint.h>", public ] },
- { symbol: [ "ino64_t", private, "<sys/types.h>", public ] },
- { symbol: [ "ino64_t", private, "<dirent.h>", public ] },
- { symbol: [ "ino_t", private, "<sys/types.h>", public ] },
- { symbol: [ "ino_t", private, "<dirent.h>", public ] },
- { symbol: [ "ino_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "int8_t", private, "<stdint.h>", public ] },
- { symbol: [ "int16_t", private, "<stdint.h>", public ] },
- { symbol: [ "int32_t", private, "<stdint.h>", public ] },
- { symbol: [ "int64_t", private, "<stdint.h>", public ] },
- { symbol: [ "uint8_t", private, "<stdint.h>", public ] },
- { symbol: [ "uint16_t", private, "<stdint.h>", public ] },
- { symbol: [ "uint32_t", private, "<stdint.h>", public ] },
- { symbol: [ "uint64_t", private, "<stdint.h>", public ] },
- { symbol: [ "intptr_t", private, "<stdint.h>", public ] },
- { symbol: [ "uintptr_t", private, "<stdint.h>", public ] },
- { symbol: [ "iovec", private, "<sys/uio.h>", public ] },
- { symbol: [ "iovec", private, "<sys/socket.h>", private ] },
- { symbol: [ "itimerspec", private, "<time.h>", public ] },
- { symbol: [ "itimerspec", private, "<sys/timerfd.h>", public ] },
- { symbol: [ "key_t", private, "<sys/types.h>", public ] },
- { symbol: [ "key_t", private, "<sys/ipc.h>", public ] },
- { symbol: [ "lconv", private, "<locale.h>", public ] },
- { symbol: [ "ldiv_t", private, "<stdlib.h>", public ] },
- { symbol: [ "lldiv_t", private, "<stdlib.h>", public ] },
- { symbol: [ "max_align_t", private, "<stddef.h>", public ] },
- { symbol: [ "mode_t", private, "<sys/types.h>", public ] },
- { symbol: [ "mode_t", private, "<fcntl.h>", public ] },
- { symbol: [ "mode_t", private, "<ndbm.h>", public ] },
- { symbol: [ "mode_t", private, "<spawn.h>", public ] },
- { symbol: [ "mode_t", private, "<sys/ipc.h>", public ] },
- { symbol: [ "mode_t", private, "<sys/mman.h>", public ] },
- { symbol: [ "mode_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "nlink_t", private, "<sys/types.h>", public ] },
- { symbol: [ "nlink_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "ntohl", private, "<arpa/inet.h>", private ] },
- { symbol: [ "ntohs", private, "<arpa/inet.h>", private ] },
- { symbol: [ "off64_t", private, "<sys/types.h>", public ] },
- { symbol: [ "off64_t", private, "<unistd.h>", private ] },
- { symbol: [ "off_t", private, "<sys/types.h>", public ] },
- { symbol: [ "off_t", private, "<aio.h>", public ] },
- { symbol: [ "off_t", private, "<fcntl.h>", public ] },
- { symbol: [ "off_t", private, "<stdio.h>", public ] },
- { symbol: [ "off_t", private, "<sys/mman.h>", public ] },
- { symbol: [ "off_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "off_t", private, "<unistd.h>", private ] },
- { symbol: [ "optarg", private, "<unistd.h>", private ] },
- { symbol: [ "opterr", private, "<unistd.h>", private ] },
- { symbol: [ "optind", private, "<unistd.h>", private ] },
- { symbol: [ "optopt", private, "<unistd.h>", private ] },
- { symbol: [ "pid_t", private, "<sys/types.h>", public ] },
- { symbol: [ "pid_t", private, "<fcntl.h>", public ] },
- { symbol: [ "pid_t", private, "<sched.h>", public ] },
- { symbol: [ "pid_t", private, "<signal.h>", public ] },
- { symbol: [ "pid_t", private, "<spawn.h>", public ] },
- { symbol: [ "pid_t", private, "<sys/msg.h>", public ] },
- { symbol: [ "pid_t", private, "<sys/sem.h>", public ] },
- { symbol: [ "pid_t", private, "<sys/shm.h>", public ] },
- { symbol: [ "pid_t", private, "<sys/wait.h>", public ] },
- { symbol: [ "pid_t", private, "<termios.h>", private ] },
- { symbol: [ "pid_t", private, "<time.h>", public ] },
- { symbol: [ "pid_t", private, "<unistd.h>", private ] },
- { symbol: [ "pid_t", private, "<utmpx.h>", public ] },
- { symbol: [ "ptrdiff_t", private, "<stddef.h>", public ] },
- { symbol: [ "regex_t", private, "<regex.h>", public ] },
- { symbol: [ "regmatch_t", private, "<regex.h>", public ] },
- { symbol: [ "regoff_t", private, "<regex.h>", public ] },
- { symbol: [ "sigevent", private, "<signal.h>", public ] },
- { symbol: [ "sigevent", private, "<aio.h>", public ] },
- { symbol: [ "sigevent", private, "<mqueue.h>", public ] },
- { symbol: [ "sigevent", private, "<time.h>", public ] },
- { symbol: [ "siginfo_t", private, "<signal.h>", public ] },
- { symbol: [ "siginfo_t", private, "<sys/wait.h>", public ] },
- { symbol: [ "sigset_t", private, "<signal.h>", public ] },
- { symbol: [ "sigset_t", private, "<spawn.h>", public ] },
- { symbol: [ "sigset_t", private, "<sys/select.h>", public ] },
- { symbol: [ "sigval", private, "<signal.h>", public ] },
- { symbol: [ "sockaddr", private, "<sys/socket.h>", private ] },
- { symbol: [ "socklen_t", private, "<sys/socket.h>", private ] },
- { symbol: [ "socklen_t", private, "<netdb.h>", private ] },
- { symbol: [ "ssize_t", private, "<sys/types.h>", public ] },
- { symbol: [ "ssize_t", private, "<aio.h>", public ] },
- { symbol: [ "ssize_t", private, "<monetary.h>", public ] },
- { symbol: [ "ssize_t", private, "<mqueue.h>", public ] },
- { symbol: [ "ssize_t", private, "<stdio.h>", public ] },
- { symbol: [ "ssize_t", private, "<sys/msg.h>", public ] },
- { symbol: [ "ssize_t", private, "<sys/socket.h>", private ] },
- { symbol: [ "ssize_t", private, "<sys/uio.h>", public ] },
- { symbol: [ "ssize_t", private, "<unistd.h>", private ] },
- { symbol: [ "stat", private, "<sys/stat.h>", public ] },
- { symbol: [ "stat", private, "<ftw.h>", public ] },
- { symbol: [ "suseconds_t", private, "<sys/types.h>", public ] },
- { symbol: [ "suseconds_t", private, "<sys/select.h>", public ] },
- { symbol: [ "suseconds_t", private, "<sys/time.h>", public ] },
- { symbol: [ "time_t", private, "<time.h>", public ] },
- { symbol: [ "time_t", private, "<sched.h>", public ] },
- { symbol: [ "time_t", private, "<sys/msg.h>", public ] },
- { symbol: [ "time_t", private, "<sys/select.h>", public ] },
- { symbol: [ "time_t", private, "<sys/sem.h>", public ] },
- { symbol: [ "time_t", private, "<sys/shm.h>", public ] },
- { symbol: [ "time_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "time_t", private, "<sys/time.h>", public ] },
- { symbol: [ "time_t", private, "<sys/types.h>", public ] },
- { symbol: [ "time_t", private, "<utime.h>", public ] },
- { symbol: [ "timer_t", private, "<sys/types.h>", public ] },
- { symbol: [ "timer_t", private, "<time.h>", public ] },
- { symbol: [ "timespec", private, "<time.h>", public ] },
- { symbol: [ "timespec", private, "<aio.h>", public ] },
- { symbol: [ "timespec", private, "<mqueue.h>", public ] },
- { symbol: [ "timespec", private, "<sched.h>", public ] },
- { symbol: [ "timespec", private, "<signal.h>", public ] },
- { symbol: [ "timespec", private, "<sys/select.h>", public ] },
- { symbol: [ "timespec", private, "<sys/stat.h>", public ] },
- { symbol: [ "timeval", private, "<sys/time.h>", public ] },
- { symbol: [ "timeval", private, "<sys/resource.h>", public ] },
- { symbol: [ "timeval", private, "<sys/select.h>", public ] },
- { symbol: [ "timeval", private, "<utmpx.h>", public ] },
- { symbol: [ "tm", private, "<time.h>", public ] },
- { symbol: [ "u_char", private, "<sys/types.h>", public ] },
- { symbol: [ "u_char", private, "<rpc/types.h>", public ] },
- { symbol: [ "uid_t", private, "<sys/types.h>", public ] },
- { symbol: [ "uid_t", private, "<pwd.h>", public ] },
- { symbol: [ "uid_t", private, "<signal.h>", public ] },
- { symbol: [ "uid_t", private, "<stropts.h>", public ] },
- { symbol: [ "uid_t", private, "<sys/ipc.h>", public ] },
- { symbol: [ "uid_t", private, "<sys/stat.h>", public ] },
- { symbol: [ "uid_t", private, "<unistd.h>", private ] },
- { symbol: [ "useconds_t", private, "<sys/types.h>", public ] },
- { symbol: [ "useconds_t", private, "<unistd.h>", private ] },
- { symbol: [ "wchar_t", private, "<stddef.h>", public ] },
- { symbol: [ "wchar_t", private, "<stdlib.h>", public ] },
- { symbol: [ "size_t", private, "<stddef.h>", public ] },
- { symbol: [ "size_t", private, "<aio.h>", public ] },
- { symbol: [ "size_t", private, "<glob.h>", public ] },
- { symbol: [ "size_t", private, "<grp.h>", public ] },
- { symbol: [ "size_t", private, "<iconv.h>", public ] },
- { symbol: [ "size_t", private, "<monetary.h>", public ] },
- { symbol: [ "size_t", private, "<mqueue.h>", public ] },
- { symbol: [ "size_t", private, "<ndbm.h>", public ] },
- { symbol: [ "size_t", private, "<pwd.h>", public ] },
- { symbol: [ "size_t", private, "<regex.h>", public ] },
- { symbol: [ "size_t", private, "<search.h>", public ] },
- { symbol: [ "size_t", private, "<signal.h>", public ] },
- { symbol: [ "size_t", private, "<stdio.h>", public ] },
- { symbol: [ "size_t", private, "<stdlib.h>", public ] },
- { symbol: [ "size_t", private, "<string.h>", public ] },
- { symbol: [ "size_t", private, "<strings.h>", public ] },
- { symbol: [ "size_t", private, "<sys/mman.h>", public ] },
- { symbol: [ "size_t", private, "<sys/msg.h>", public ] },
- { symbol: [ "size_t", private, "<sys/sem.h>", public ] },
- { symbol: [ "size_t", private, "<sys/shm.h>", public ] },
- { symbol: [ "size_t", private, "<sys/socket.h>", private ] },
- { symbol: [ "size_t", private, "<sys/types.h>", public ] },
- { symbol: [ "size_t", private, "<sys/uio.h>", public ] },
- { symbol: [ "size_t", private, "<time.h>", public ] },
- { symbol: [ "size_t", private, "<uchar.h>", public ] },
- { symbol: [ "size_t", private, "<unistd.h>", private ] },
- { symbol: [ "size_t", private, "<wchar.h>", public ] },
- { symbol: [ "size_t", private, "<wordexp.h>", public ] },
- # Macros that can be defined in more than one file, don't have the
- # same __foo_defined guard that other types do, so the grep above
- # doesn't discover them. Until I figure out a better way, I just
- # add them in by hand as I discover them.
- { symbol: [ "EOF", private, "<stdio.h>", public ] },
- { symbol: [ "EOF", private, "<libio.h>", public ] },
- { symbol: [ "FILE", private, "<stdio.h>", public ] },
- { symbol: [ "MAP_POPULATE", private, "<sys/mman.h>", public ] },
- { symbol: [ "MAP_POPULATE", private, "<linux/mman.h>", public ] },
- { symbol: [ "MAP_STACK", private, "<sys/mman.h>", public ] },
- { symbol: [ "MAP_STACK", private, "<linux/mman.h>", public ] },
- { symbol: [ "MAXHOSTNAMELEN", private, "<sys/param.h>", public ] },
- { symbol: [ "MAXHOSTNAMELEN", private, "<protocols/timed.h>", public ] },
- { symbol: [ "SIGABRT", private, "<signal.h>", public ] },
- { symbol: [ "SIGCHLD", private, "<signal.h>", public ] },
- { symbol: [ "SIGCHLD", private, "<linux/signal.h>", public ] },
- { symbol: [ "va_list", private, "<stdarg.h>", public ] },
- { symbol: [ "va_list", private, "<stdio.h>", public ] },
- { symbol: [ "va_list", private, "<wchar.h>", public ] },
- # These are symbols that could be defined in either stdlib.h or
- # malloc.h, but we always want the stdlib location.
- { symbol: [ "malloc", private, "<stdlib.h>", public ] },
- { symbol: [ "calloc", private, "<stdlib.h>", public ] },
- { symbol: [ "realloc", private, "<stdlib.h>", public ] },
- { symbol: [ "free", private, "<stdlib.h>", public ] },
- # Entries for NULL
- { symbol: [ "NULL", private, "<stddef.h>", public ] }, # 'canonical' location for NULL
- { symbol: [ "NULL", private, "<clocale>", public ] },
- { symbol: [ "NULL", private, "<cstddef>", public ] },
- { symbol: [ "NULL", private, "<cstdio>", public ] },
- { symbol: [ "NULL", private, "<cstdlib>", public ] },
- { symbol: [ "NULL", private, "<cstring>", public ] },
- { symbol: [ "NULL", private, "<ctime>", public ] },
- { symbol: [ "NULL", private, "<cwchar>", public ] },
- { symbol: [ "NULL", private, "<locale.h>", public ] },
- { symbol: [ "NULL", private, "<stdio.h>", public ] },
- { symbol: [ "NULL", private, "<stdlib.h>", public ] },
- { symbol: [ "NULL", private, "<string.h>", public ] },
- { symbol: [ "NULL", private, "<time.h>", public ] },
- { symbol: [ "NULL", private, "<unistd.h>", private ] },
- { symbol: [ "NULL", private, "<wchar.h>", public ] },
-
- # Kludge time: almost all STL types take an allocator, but they
- # almost always use the default value. Usually we detect that
- # and don't try to do IWYU, but sometimes it passes through.
- # For instance, when adding two strings, we end up calling
- # template<_CharT,_Traits,_Alloc> ... operator+(
- # basic_string<_CharT,_Traits,_Alloc>, ...)
- # These look like normal template args to us, so we see they're
- # used and declare an iwyu dependency, even though we don't need
- # to #include the traits or alloc type ourselves. The surest way
- # to deal with this is to just say that everyone provides
- # std::allocator. We can add more here at need.
- { symbol: [ "std::allocator", private, "<memory>", public ] },
- { symbol: [ "std::allocator", private, "<string>", public ] },
- { symbol: [ "std::allocator", private, "<vector>", public ] },
- { symbol: [ "std::allocator", private, "<map>", public ] },
- { symbol: [ "std::allocator", private, "<set>", public ] },
- # A similar kludge for std::char_traits. basic_string,
- # basic_ostream and basic_istream have this as a default template
- # argument, and sometimes it bleeds through when clang desugars the
- # string/ostream/istream type.
- { symbol: [ "std::char_traits", private, "<string>", public ] },
- { symbol: [ "std::char_traits", private, "<ostream>", public ] },
- { symbol: [ "std::char_traits", private, "<istream>", public ] },
-
- { symbol: [ "std::size_t", private, "<cstddef>", public ] },
- { symbol: [ "std::size_t", private, "<cstdio>", public ] },
- { symbol: [ "std::size_t", private, "<cstdlib>", public ] },
- { symbol: [ "std::size_t", private, "<cstring>", public ] },
- { symbol: [ "std::size_t", private, "<ctime>", public ] },
- { symbol: [ "std::size_t", private, "<cuchar>", public ] },
- { symbol: [ "std::size_t", private, "<cwchar>", public ] }
-]
-
-# vim: set ft=toml:
diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp
index 465ab2118d..5ba6c56127 100644
--- a/cmake.config/iwyu/mapping.imp
+++ b/cmake.config/iwyu/mapping.imp
@@ -1,4 +1,7 @@
[
+ { ref: "c99.imp" },
+ { ref: "posix.imp" },
+
# Generated to normal headers: header.h.generated.h -> nvim/header.h
{ include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] },
{ include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] },
@@ -221,28 +224,19 @@
{ include: [ '"nvim/tui/input_defs.h"', public, '"nvim/tui/input.h"', public ] },
{ include: [ '"nvim/undo_defs.h"', public, '"nvim/undo.h"', public ] },
- # Third party headers
- { include: [ "<bits/types/wint_t.h>", private, "<wchar.h>", public ] },
- { include: [ '<arpa/inet.h>', private, '<uv/unix.h>', private ] },
- { include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', private ] },
- { include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', private ] },
- { include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', private ] },
- { include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', private ] },
- { include: [ '<libintl.h>', private, '"nvim/gettext.h"', public ] },
- { include: [ '<netdb.h>', private, '<uv/unix.h>', private ] },
- { include: [ '<netinet/in.h>', private, '<uv/unix.h>', private ] },
- { include: [ '<pthread.h>', private, '"nvim/os/unix_defs.h"', private ] },
- { include: [ '<sys/socket.h>', private, '<uv/unix.h>', private ] },
- { include: [ '<termios.h>', private, '"nvim/os/unix_defs.h"', private ] },
- { include: [ '<unistd.h>', private, '"nvim/os/unix_defs.h"', private ] },
- { include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
-
# Symbols
{ symbol: [ "MAX", private, '"nvim/macros.h"', public ] },
{ symbol: [ "MIN", private, '"nvim/macros.h"', public ] },
- { symbol: [ "SEEK_END", private, '<stdio.h>', public ] },
- { symbol: [ "SEEK_SET", private, '<stdio.h>', public ] },
- { symbol: [ "time_fd", private, '"nvim/globals.h"', public ] },
+
+ # Third party headers
+ { include: [ '<libintl.h>', public, '"nvim/gettext.h"', public ] },
+ { include: [ '<netdb.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<netinet/in.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<pthread.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<sys/socket.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<termios.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<unistd.h>', public, '"nvim/os/unix_defs.h"', private ] },
+ { include: [ '<uv/unix.h>', public, '<uv.h>', public ] },
]
# vim: set ft=toml:
diff --git a/cmake.config/iwyu/posix.imp b/cmake.config/iwyu/posix.imp
new file mode 100644
index 0000000000..b15c1186d9
--- /dev/null
+++ b/cmake.config/iwyu/posix.imp
@@ -0,0 +1,110 @@
+[
+ # bits/ioctls.h
+ { include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
+
+ # errno.h
+ { symbol: ["E2BIG", private, "<errno.h>", public ] },
+ { symbol: ["EACCES", private, "<errno.h>", public ] },
+ { symbol: ["EADDRINUSE", private, "<errno.h>", public ] },
+ { symbol: ["EADDRNOTAVAIL", private, "<errno.h>", public ] },
+ { symbol: ["EAFNOSUPPORT", private, "<errno.h>", public ] },
+ { symbol: ["EAGAIN", private, "<errno.h>", public ] },
+ { symbol: ["EALREADY", private, "<errno.h>", public ] },
+ { symbol: ["EBADF", private, "<errno.h>", public ] },
+ { symbol: ["EBADMSG", private, "<errno.h>", public ] },
+ { symbol: ["EBUSY", private, "<errno.h>", public ] },
+ { symbol: ["ECANCELED", private, "<errno.h>", public ] },
+ { symbol: ["ECHILD", private, "<errno.h>", public ] },
+ { symbol: ["ECONNABORTED", private, "<errno.h>", public ] },
+ { symbol: ["ECONNREFUSED", private, "<errno.h>", public ] },
+ { symbol: ["ECONNRESET", private, "<errno.h>", public ] },
+ { symbol: ["EDEADLK", private, "<errno.h>", public ] },
+ { symbol: ["EDESTADDRREQ", private, "<errno.h>", public ] },
+ { symbol: ["EDOM", private, "<errno.h>", public ] },
+ { symbol: ["EDQUOT", private, "<errno.h>", public ] },
+ { symbol: ["EEXIST", private, "<errno.h>", public ] },
+ { symbol: ["EFAULT", private, "<errno.h>", public ] },
+ { symbol: ["EFBIG", private, "<errno.h>", public ] },
+ { symbol: ["EHOSTUNREACH", private, "<errno.h>", public ] },
+ { symbol: ["EIDRM", private, "<errno.h>", public ] },
+ { symbol: ["EILSEQ", private, "<errno.h>", public ] },
+ { symbol: ["EINPROGRESS", private, "<errno.h>", public ] },
+ { symbol: ["EINTR", private, "<errno.h>", public ] },
+ { symbol: ["EINVAL", private, "<errno.h>", public ] },
+ { symbol: ["EIO", private, "<errno.h>", public ] },
+ { symbol: ["EISCONN", private, "<errno.h>", public ] },
+ { symbol: ["EISDIR", private, "<errno.h>", public ] },
+ { symbol: ["ELOOP", private, "<errno.h>", public ] },
+ { symbol: ["EMFILE", private, "<errno.h>", public ] },
+ { symbol: ["EMLINK", private, "<errno.h>", public ] },
+ { symbol: ["EMSGSIZE", private, "<errno.h>", public ] },
+ { symbol: ["EMULTIHOP", private, "<errno.h>", public ] },
+ { symbol: ["ENAMETOOLONG", private, "<errno.h>", public ] },
+ { symbol: ["ENETDOWN", private, "<errno.h>", public ] },
+ { symbol: ["ENETRESET", private, "<errno.h>", public ] },
+ { symbol: ["ENETUNREACH", private, "<errno.h>", public ] },
+ { symbol: ["ENFILE", private, "<errno.h>", public ] },
+ { symbol: ["ENOBUFS", private, "<errno.h>", public ] },
+ { symbol: ["ENODATA", private, "<errno.h>", public ] },
+ { symbol: ["ENODEV", private, "<errno.h>", public ] },
+ { symbol: ["ENOENT", private, "<errno.h>", public ] },
+ { symbol: ["ENOEXEC", private, "<errno.h>", public ] },
+ { symbol: ["ENOLCK", private, "<errno.h>", public ] },
+ { symbol: ["ENOLINK", private, "<errno.h>", public ] },
+ { symbol: ["ENOMEM", private, "<errno.h>", public ] },
+ { symbol: ["ENOMSG", private, "<errno.h>", public ] },
+ { symbol: ["ENOPROTOOPT", private, "<errno.h>", public ] },
+ { symbol: ["ENOSPC", private, "<errno.h>", public ] },
+ { symbol: ["ENOSR", private, "<errno.h>", public ] },
+ { symbol: ["ENOSTR", private, "<errno.h>", public ] },
+ { symbol: ["ENOSYS", private, "<errno.h>", public ] },
+ { symbol: ["ENOTCONN", private, "<errno.h>", public ] },
+ { symbol: ["ENOTDIR", private, "<errno.h>", public ] },
+ { symbol: ["ENOTEMPTY", private, "<errno.h>", public ] },
+ { symbol: ["ENOTRECOVERABLE", private, "<errno.h>", public ] },
+ { symbol: ["ENOTSOCK", private, "<errno.h>", public ] },
+ { symbol: ["ENOTSUP", private, "<errno.h>", public ] },
+ { symbol: ["ENOTTY", private, "<errno.h>", public ] },
+ { symbol: ["ENXIO", private, "<errno.h>", public ] },
+ { symbol: ["EOPNOTSUPP", private, "<errno.h>", public ] },
+ { symbol: ["EOVERFLOW", private, "<errno.h>", public ] },
+ { symbol: ["EOWNERDEAD", private, "<errno.h>", public ] },
+ { symbol: ["EPERM", private, "<errno.h>", public ] },
+ { symbol: ["EPIPE", private, "<errno.h>", public ] },
+ { symbol: ["EPROTO", private, "<errno.h>", public ] },
+ { symbol: ["EPROTONOSUPPORT", private, "<errno.h>", public ] },
+ { symbol: ["EPROTOTYPE", private, "<errno.h>", public ] },
+ { symbol: ["ERANGE", private, "<errno.h>", public ] },
+ { symbol: ["EROFS", private, "<errno.h>", public ] },
+ { symbol: ["ESPIPE", private, "<errno.h>", public ] },
+ { symbol: ["ESRCH", private, "<errno.h>", public ] },
+ { symbol: ["ESTALE", private, "<errno.h>", public ] },
+ { symbol: ["ETIME", private, "<errno.h>", public ] },
+ { symbol: ["ETIMEDOUT", private, "<errno.h>", public ] },
+ { symbol: ["ETXTBSY", private, "<errno.h>", public ] },
+ { symbol: ["EWOULDBLOCK", private, "<errno.h>", public ] },
+ { symbol: ["EXDEV", private, "<errno.h>", public ] },
+
+ # limits.h
+ { symbol: ["SSIZE_MAX", private, "<limits.h>", public ] },
+
+ # signal.h
+ { symbol: [ "sigset_t", private, "<signal.h>", public ] },
+
+ # sys/socket.h
+ { symbol: [ "iovec", private, "<sys/socket.h>", public ] },
+ { symbol: ["SOCK_STREAM", private, "<sys/socket.h>", public ] },
+
+ # termios.h
+ { include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] },
+ { include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
+ { include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', public ] },
+ { include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', public ] },
+ { include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', public ] },
+ { include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', public ] },
+
+ # <unistd.h
+ { symbol: ["_POSIX_VDISABLE", private, "<unistd.h>", public ] },
+]
+
+# vim: set ft=toml:
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index cf2ee9c6b5..59af5e3818 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -259,9 +259,7 @@ if(ENABLE_IWYU)
set(iwyu_flags "${IWYU_PRG};")
string(APPEND iwyu_flags "-Xiwyu;--no_default_mappings;")
- string(APPEND iwyu_flags "-Xiwyu;--mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/mapping.imp;")
- string(APPEND iwyu_flags "-Xiwyu;--mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/gcc.libc.imp;")
- string(APPEND iwyu_flags "-Xiwyu;--mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/gcc.symbols.imp")
+ string(APPEND iwyu_flags "-Xiwyu;--mapping_file=${PROJECT_SOURCE_DIR}/cmake.config/iwyu/mapping.imp")
set_target_properties(nvim PROPERTIES C_INCLUDE_WHAT_YOU_USE "${iwyu_flags}")
target_compile_definitions(main_lib INTERFACE EXITFREE)
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c
index b4aa6fe99e..9ea0de4b89 100644
--- a/src/nvim/api/deprecated.c
+++ b/src/nvim/api/deprecated.c
@@ -13,6 +13,7 @@
#include "nvim/api/vimscript.h"
#include "nvim/buffer_defs.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/extmark.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
@@ -21,7 +22,6 @@
#include "nvim/memory.h"
#include "nvim/option.h"
#include "nvim/pos.h"
-#include "nvim/types.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/deprecated.c.generated.h"
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c
index 8a2cde8372..d2e387f478 100644
--- a/src/nvim/api/extmark.c
+++ b/src/nvim/api/extmark.c
@@ -13,6 +13,7 @@
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/decoration_provider.h"
#include "nvim/drawscreen.h"
#include "nvim/extmark.h"
@@ -23,8 +24,6 @@
#include "nvim/memory.h"
#include "nvim/pos.h"
#include "nvim/sign.h"
-#include "nvim/strings.h"
-#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/extmark.c.generated.h"
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 4b16e26103..a35ad57d8f 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -11,8 +11,8 @@
#include "nvim/autocmd.h"
#include "nvim/buffer_defs.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/drawscreen.h"
-#include "nvim/extmark_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight_group.h"
diff --git a/src/nvim/change.c b/src/nvim/change.c
index aa58779f5b..f9eeab38c8 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -23,7 +23,6 @@
#include "nvim/fold.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/grid_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 9a7de8ecef..d3312516c6 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -19,7 +19,6 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/garray.h"
#include "nvim/globals.h"
-#include "nvim/grid_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros.h"
#include "nvim/mbyte.h"
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c
index 43b07501a0..f860b65c93 100644
--- a/src/nvim/decoration.c
+++ b/src/nvim/decoration.c
@@ -1,7 +1,13 @@
#include <assert.h>
#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
+#include "nvim/api/private/helpers.h"
+#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/decoration.h"
#include "nvim/drawscreen.h"
@@ -9,8 +15,10 @@
#include "nvim/fold.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
+#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/move.h"
+#include "nvim/option_vars.h"
#include "nvim/pos.h"
#include "nvim/sign.h"
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 6f34767907..0d405622b6 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -15,12 +15,12 @@
#include "nvim/cursor.h"
#include "nvim/cursor_shape.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/decoration_provider.h"
#include "nvim/diff.h"
#include "nvim/drawline.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
-#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index b28c279163..c6fd186ef2 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -68,6 +68,7 @@
#include "nvim/cmdexpand.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/decoration_provider.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
@@ -75,7 +76,6 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/ex_getln.h"
-#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
@@ -99,6 +99,7 @@
#include "nvim/profile.h"
#include "nvim/regexp.h"
#include "nvim/search.h"
+#include "nvim/sign_defs.h"
#include "nvim/spell.h"
#include "nvim/state.h"
#include "nvim/statusline.h"
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index c370224476..2e9dce8b5b 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -8,11 +8,13 @@
#include <msgpack/pack.h>
#include <msgpack/unpack.h>
#include <signal.h>
+#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <time.h>
#include <uv.h>
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index 3fd33720c9..cf02bbe224 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -7,6 +7,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include "nvim/ascii.h"
#include "nvim/autocmd.h"
diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c
index 13d954b92d..2f21fcf2ac 100644
--- a/src/nvim/event/libuv_process.c
+++ b/src/nvim/event/libuv_process.c
@@ -1,4 +1,5 @@
#include <assert.h>
+#include <locale.h>
#include <stdint.h>
#include <uv.h>
diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h
index 977ed8a1ee..5665332e95 100644
--- a/src/nvim/event/loop.h
+++ b/src/nvim/event/loop.h
@@ -1,5 +1,6 @@
#pragma once
+#include <stdbool.h>
#include <stdint.h>
#include <uv.h>
diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c
index 328fa68806..677b7e8e6a 100644
--- a/src/nvim/event/multiqueue.c
+++ b/src/nvim/event/multiqueue.c
@@ -45,7 +45,6 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
-#include <uv.h>
#include "nvim/event/defs.h"
#include "nvim/event/multiqueue.h"
diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c
index 4721bbdcb7..218293e44a 100644
--- a/src/nvim/event/rstream.c
+++ b/src/nvim/event/rstream.c
@@ -2,6 +2,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <uv.h>
#include "nvim/event/loop.h"
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index c406364491..324364a297 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4,6 +4,7 @@
#include <ctype.h>
#include <float.h>
#include <inttypes.h>
+#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
@@ -46,7 +47,6 @@
#include "nvim/getchar.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/grid_defs.h"
#include "nvim/help.h"
#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index 08a1539bfc..7bfa7ae62f 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -28,17 +28,16 @@
#include <assert.h>
#include "nvim/api/private/defs.h"
-#include "nvim/api/private/helpers.h"
#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/extmark.h"
#include "nvim/extmark_defs.h"
#include "nvim/globals.h"
#include "nvim/map.h"
#include "nvim/marktree.h"
#include "nvim/memline.h"
-#include "nvim/memory.h"
#include "nvim/pos.h"
#include "nvim/undo.h"
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 5bf3410614..fce2ddc211 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
+#include <time.h>
#include <uv.h>
#include "auto/config.h"
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 4c596d9d96..477e4a20cd 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -20,6 +20,7 @@
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/diff.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
diff --git a/src/nvim/input.c b/src/nvim/input.c
index d6ade22fdb..d3ac180ffc 100644
--- a/src/nvim/input.c
+++ b/src/nvim/input.c
@@ -1,6 +1,7 @@
// input.c: high level functions for prompting the user or input
// like yes/no or number prompts.
+#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index a200b0a32f..c1e0af5aa1 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -5,8 +5,8 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
-#include <sys/types.h>
#ifdef NVIM_VENDOR_BIT
# include "bit.h"
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 92eddb3cf1..37764498c8 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -62,7 +62,6 @@
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/os.h"
-#include "nvim/os/os_defs.h"
#include "nvim/pos.h"
#include "nvim/strings.h"
#include "nvim/types.h"
diff --git a/src/nvim/move.c b/src/nvim/move.c
index a719386084..6724ded9d8 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -17,7 +17,6 @@
#include "nvim/buffer.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
-#include "nvim/drawline.h"
#include "nvim/drawscreen.h"
#include "nvim/edit.h"
#include "nvim/eval/typval.h"
@@ -41,6 +40,7 @@
#include "nvim/popupmenu.h"
#include "nvim/pos.h"
#include "nvim/search.h"
+#include "nvim/sign_defs.h"
#include "nvim/strings.h"
#include "nvim/types.h"
#include "nvim/vim.h"
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 21803be226..382fdca8fa 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -7,7 +7,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <uv.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 0fae498b25..d4e8328ddd 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -52,7 +52,6 @@
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index e2a6136ab4..82916eca7b 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <uv.h>
#ifdef MSWIN
diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h
index 42d649d773..b90e306932 100644
--- a/src/nvim/os/unix_defs.h
+++ b/src/nvim/os/unix_defs.h
@@ -1,6 +1,7 @@
#pragma once
#include <sys/param.h>
+#include <sys/socket.h>
#include <unistd.h>
#if defined(HAVE_TERMIOS_H)
# include <termios.h>
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index acbb9637a4..7f6472ab42 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -8,6 +8,7 @@
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/diff.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index f91d0cabdb..496b93106d 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -24,7 +24,6 @@
#include "nvim/garray.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/grid_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros.h"
#include "nvim/mark.h"
diff --git a/src/nvim/sign.c b/src/nvim/sign.c
index 243e9e57cf..af7b2ca5df 100644
--- a/src/nvim/sign.c
+++ b/src/nvim/sign.c
@@ -1,18 +1,24 @@
// sign.c: functions for managing with signs
+#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "klib/kvec.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
+#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor.h"
+#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/drawscreen.h"
#include "nvim/edit.h"
#include "nvim/eval/funcs.h"
@@ -26,6 +32,8 @@
#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros.h"
+#include "nvim/map.h"
+#include "nvim/marktree.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index 9d34cf926f..92856d6d8c 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -2,7 +2,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <uv.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 323227d4c0..4bbdea8def 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -34,6 +34,7 @@
#include "nvim/tui/tui.h"
#include "nvim/types.h"
#include "nvim/ugrid.h"
+#include "nvim/ui.h"
#include "nvim/ui_client.h"
#ifdef MSWIN