diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /cmake.config | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'cmake.config')
-rw-r--r-- | cmake.config/CMakeLists.txt | 50 | ||||
-rw-r--r-- | cmake.config/config.h.in | 5 | ||||
-rw-r--r-- | cmake.config/iwyu/gcc.libc.imp | 226 | ||||
-rw-r--r-- | cmake.config/iwyu/gcc.symbols.imp | 305 | ||||
-rw-r--r-- | cmake.config/iwyu/mapping.imp | 238 | ||||
-rw-r--r-- | cmake.config/pathdef.c.in | 4 |
6 files changed, 813 insertions, 15 deletions
diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt index 8c86b89e43..6de86cbaf2 100644 --- a/cmake.config/CMakeLists.txt +++ b/cmake.config/CMakeLists.txt @@ -5,6 +5,26 @@ include(CheckIncludeFiles) include(CheckCSourceRuns) include(CheckCSourceCompiles) +check_c_source_compiles(" +#include <execinfo.h> +int main(void) +{ + void *trace[1]; + backtrace(trace, 1); + return 0; +} +" HAVE_EXECINFO_BACKTRACE) + +check_c_source_compiles(" +int main(void) +{ + int a = 42; + __builtin_add_overflow(a, a, &a); + __builtin_sub_overflow(a, a, &a); + return 0; +} +" HAVE_BUILTIN_ADD_OVERFLOW) + check_type_size("int" SIZEOF_INT LANGUAGE C) check_type_size("long" SIZEOF_LONG LANGUAGE C) check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C) @@ -20,11 +40,6 @@ check_include_files(langinfo.h HAVE_LANGINFO_H) check_include_files(locale.h HAVE_LOCALE_H) check_include_files(pwd.h HAVE_PWD_H) check_include_files(strings.h HAVE_STRINGS_H) -check_include_files(sys/wait.h HAVE_SYS_WAIT_H) -if(NOT HAVE_SYS_WAIT_H AND UNIX) - # See if_cscope.c - message(SEND_ERROR "header sys/wait.h is required for Unix") -endif() check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H) check_include_files(termios.h HAVE_TERMIOS_H) check_include_files(sys/uio.h HAVE_SYS_UIO_H) @@ -36,11 +51,6 @@ check_function_exists(getpwent HAVE_GETPWENT) check_function_exists(getpwnam HAVE_GETPWNAM) check_function_exists(getpwuid HAVE_GETPWUID) check_function_exists(readv HAVE_READV) - -if(Iconv_FOUND) - set(HAVE_ICONV 1) -endif() - check_function_exists(opendir HAVE_OPENDIR) check_function_exists(readlink HAVE_READLINK) check_function_exists(setpgid HAVE_SETPGID) @@ -51,6 +61,26 @@ check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(strncasecmp HAVE_STRNCASECMP) check_function_exists(strptime HAVE_STRPTIME) +check_c_source_compiles(" +#include <sys/types.h> +#include <dirent.h> +int main(void) +{ + DIR *dir = opendir(\"dirname\"); + dirfd(dir); + return 0; +} +" HAVE_DIRFD) + +check_c_source_compiles(" +#include <sys/file.h> +int main(void) +{ + flock(10, LOCK_SH); + return 0; +} +" HAVE_FLOCK) + if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") check_c_source_compiles(" #include <termios.h> diff --git a/cmake.config/config.h.in b/cmake.config/config.h.in index 59be83fb5e..c8377bf45c 100644 --- a/cmake.config/config.h.in +++ b/cmake.config/config.h.in @@ -24,7 +24,6 @@ #cmakedefine HAVE_GETPWENT #cmakedefine HAVE_GETPWNAM #cmakedefine HAVE_GETPWUID -#cmakedefine HAVE_ICONV #cmakedefine HAVE_LANGINFO_H #cmakedefine HAVE_LOCALE_H #cmakedefine HAVE_NL_LANGINFO_CODESET @@ -54,10 +53,10 @@ # undef HAVE_SYS_UIO_H # endif #endif +#cmakedefine HAVE_DIRFD +#cmakedefine HAVE_FLOCK #cmakedefine HAVE_FORKPTY -#cmakedefine FEAT_TUI - #ifndef UNIT_TESTING #cmakedefine LOG_LIST_ACTIONS #endif diff --git a/cmake.config/iwyu/gcc.libc.imp b/cmake.config/iwyu/gcc.libc.imp new file mode 100644 index 0000000000..1dd0ad42c7 --- /dev/null +++ b/cmake.config/iwyu/gcc.libc.imp @@ -0,0 +1,226 @@ +# 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 new file mode 100644 index 0000000000..6066de9d09 --- /dev/null +++ b/cmake.config/iwyu/gcc.symbols.imp @@ -0,0 +1,305 @@ +# 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 new file mode 100644 index 0000000000..4e55aa9875 --- /dev/null +++ b/cmake.config/iwyu/mapping.imp @@ -0,0 +1,238 @@ +[ + # 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 ] }, + { include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] }, + { include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] }, + { include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] }, + { include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] }, + { include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] }, + { include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, + { include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, + { include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] }, + { include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, + { include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] }, + { include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] }, + { include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] }, + { include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] }, + { include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] }, + { include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] }, + { include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] }, + { include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] }, + { include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] }, + { include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] }, + { include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] }, + { include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] }, + { include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] }, + { include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] }, + { include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] }, + { include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] }, + { include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] }, + { include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] }, + { include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] }, + { include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] }, + { include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] }, + { include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] }, + { include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] }, + { include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] }, + { include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] }, + { include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] }, + { include: [ '"eval/buffer.h.generated.h"', private, '"nvim/eval/buffer.h"', public ] }, + { include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] }, + { include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] }, + { include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] }, + { include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] }, + { include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] }, + { include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] }, + { include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] }, + { include: [ '"eval/window.h.generated.h"', private, '"nvim/eval/window.h"', public ] }, + { include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] }, + { include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] }, + { include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] }, + { include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] }, + { include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] }, + { include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] }, + { include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] }, + { include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] }, + { include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] }, + { include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] }, + { include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] }, + { include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] }, + { include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] }, + { include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] }, + { include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] }, + { include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] }, + { include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] }, + { include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] }, + { include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] }, + { include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] }, + { include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] }, + { include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] }, + { include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] }, + { include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] }, + { include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] }, + { include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] }, + { include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] }, + { include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] }, + { include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] }, + { include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] }, + { include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] }, + { include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] }, + { include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] }, + { include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] }, + { include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] }, + { include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] }, + { include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] }, + { include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] }, + { include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] }, + { include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] }, + { include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] }, + { include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] }, + { include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] }, + { include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] }, + { include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] }, + { include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] }, + { include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] }, + { include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] }, + { include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] }, + { include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] }, + { include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] }, + { include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] }, + { include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] }, + { include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] }, + { include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] }, + { include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] }, + { include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] }, + { include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] }, + { include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] }, + { include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] }, + { include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] }, + { include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] }, + { include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] }, + { include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] }, + { include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] }, + { include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] }, + { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] }, + { include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] }, + { include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] }, + { include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] }, + { include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] }, + { include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] }, + { include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] }, + { include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] }, + { include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] }, + { include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] }, + { include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] }, + { include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] }, + { include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] }, + { include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] }, + { include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] }, + { include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] }, + { include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] }, + { include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] }, + { include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] }, + { include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] }, + { include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] }, + { include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] }, + { include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] }, + { include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] }, + { include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] }, + { include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] }, + { include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] }, + { include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] }, + { include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] }, + { include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] }, + { include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] }, + { include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] }, + { include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] }, + { include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] }, + { include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] }, + { include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] }, + { include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] }, + { include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] }, + { include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] }, + { include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, + { include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] }, + { include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] }, + { include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] }, + { include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] }, + { include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] }, + { include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] }, + { include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] }, + + # Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h + { include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, + { include: [ '"auevents_enum.generated.h"', private, '"nvim/autocmd.h"', public ] }, + { include: [ '"ex_cmds_enum.generated.h"', private, '"nvim/ex_cmds_defs.h"', public ] }, + { include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, + { include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] }, + { include: [ '"nvim/os/pty_process_unix.h"', private, '"nvim/os/pty_process.h"', public ] }, + { include: [ '"nvim/os/pty_process_win.h"', private, '"nvim/os/pty_process.h"', public ] }, + { include: [ '"nvim/os/unix_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, + { include: [ '"nvim/os/win_defs.h"', private, '"nvim/os/os_defs.h"', public ] }, + { include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] }, + { include: [ '"regexp_bt.h.generated.h"', private, '"nvim/regexp.h"', public ] }, + { include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] }, + { include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, + { include: [ '"ui_events_remote.generated.h"', private, '"nvim/api/ui.h"', public ] }, + { include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, + + # Def to normal headers: nvim/header_defs.h -> nvim/header.h + # + # This is a public to public mapping, meaning that while IWYU can use the + # headers on the left, it will use the headers on the right if possible. This + # isn't explicitly mentioned in the IWYU docs, this is just my interpretation + # of its behavior. + { include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] }, + { include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] }, + { include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] }, + { include: [ '"nvim/extmark_defs.h"', public, '"nvim/extmark.h"', public ] }, + { include: [ '"nvim/grid_defs.h"', public, '"nvim/grid.h"', public ] }, + { include: [ '"nvim/highlight_defs.h"', public, '"nvim/highlight.h"', public ] }, + { include: [ '"nvim/map_defs.h"', public, '"nvim/map.h"', public ] }, + { include: [ '"nvim/mark_defs.h"', public, '"nvim/mark.h"', public ] }, + { include: [ '"nvim/mbyte_defs.h"', public, '"nvim/mbyte.h"', public ] }, + { include: [ '"nvim/memfile_defs.h"', public, '"nvim/memfile.h"', public ] }, + { include: [ '"nvim/memline_defs.h"', public, '"nvim/memline.h"', public ] }, + { include: [ '"nvim/menu_defs.h"', public, '"nvim/menu.h"', public ] }, + { include: [ '"nvim/msgpack/channel_defs.h"', public, '"nvim/msgpack/channel.h"', public ] }, + { include: [ '"nvim/option_defs.h"', public, '"nvim/option.h"', public ] }, + { include: [ '"nvim/os/fs_defs.h"', public, '"nvim/os/fs.h"', public ] }, + { include: [ '"nvim/os/os_defs.h"', public, '"nvim/os/os.h"', public ] }, + { include: [ '"nvim/regexp_defs.h"', public, '"nvim/regexp.h"', public ] }, + { include: [ '"nvim/sign_defs.h"', public, '"nvim/sign.h"', public ] }, + { include: [ '"nvim/spell_defs.h"', public, '"nvim/spell.h"', public ] }, + { include: [ '"nvim/statusline_defs.h"', public, '"nvim/statusline.h"', public ] }, + { include: [ '"nvim/syntax_defs.h"', public, '"nvim/syntax.h"', public ] }, + { 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 ] }, +] + +# vim: set ft=toml: diff --git a/cmake.config/pathdef.c.in b/cmake.config/pathdef.c.in index 6a8a2b205a..5d6dfa6b9f 100644 --- a/cmake.config/pathdef.c.in +++ b/cmake.config/pathdef.c.in @@ -4,5 +4,5 @@ char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim"; char *default_vimruntime_dir = ""; char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim"; -char_u *compiled_user = (char_u *)"${USERNAME}"; -char_u *compiled_sys = (char_u *)"${HOSTNAME}"; +char *compiled_user = "${USERNAME}"; +char *compiled_sys = "${HOSTNAME}"; |