diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-11-30 15:51:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-30 15:51:05 +0800 |
| commit | 543e0256c19f397921a332e06b423215fd9aecb5 (patch) | |
| tree | 5517c44128bc3a0763fc9789565b78c56e49d690 /src/nvim/os | |
| parent | 85be914879d49435c3b689efd5f1dae70e81d168 (diff) | |
| download | rneovim-543e0256c19f397921a332e06b423215fd9aecb5.tar.gz rneovim-543e0256c19f397921a332e06b423215fd9aecb5.tar.bz2 rneovim-543e0256c19f397921a332e06b423215fd9aecb5.zip | |
build: don't define FUNC_ATTR_* as empty in headers (#26317)
FUNC_ATTR_* should only be used in .c files with generated headers.
Defining FUNC_ATTR_* as empty in headers causes misuses of them to be
silently ignored. Instead don't define them by default, and only define
them as empty after a .c file has included its generated header.
Diffstat (limited to 'src/nvim/os')
| -rw-r--r-- | src/nvim/os/env.c | 5 | ||||
| -rw-r--r-- | src/nvim/os/fs.c | 1 | ||||
| -rw-r--r-- | src/nvim/os/input.c | 1 | ||||
| -rw-r--r-- | src/nvim/os/process.c | 3 | ||||
| -rw-r--r-- | src/nvim/os/pty_process_unix.c | 1 | ||||
| -rw-r--r-- | src/nvim/os/shell.c | 1 | ||||
| -rw-r--r-- | src/nvim/os/signal.c | 1 | ||||
| -rw-r--r-- | src/nvim/os/stdpaths.c | 5 | ||||
| -rw-r--r-- | src/nvim/os/time.c | 3 | ||||
| -rw-r--r-- | src/nvim/os/users.c | 4 |
10 files changed, 15 insertions, 10 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 8620c79069..b1e680e469 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -14,7 +14,6 @@ #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/eval.h" -#include "nvim/func_attr.h" #include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/log.h" @@ -46,6 +45,10 @@ # include <sys/utsname.h> #endif +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/env.c.generated.h" +#endif + // Because `uv_os_getenv` requires allocating, we must manage a map to maintain // the behavior of `os_getenv`. static PMap(cstr_t) envmap = MAP_INIT; diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 8f939c3b40..a8c7fcc38f 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -17,7 +17,6 @@ #endif #include "auto/config.h" -#include "nvim/func_attr.h" #include "nvim/os/fs.h" #if defined(HAVE_ACL) diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index f3bd1c7ed9..b86c51424c 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -12,7 +12,6 @@ #include "nvim/event/multiqueue.h" #include "nvim/event/rstream.h" #include "nvim/event/stream.h" -#include "nvim/func_attr.h" #include "nvim/getchar.h" #include "nvim/gettext.h" #include "nvim/globals.h" diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index d9ec3a7a8a..5263451488 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -44,7 +44,7 @@ #endif #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/process.c.generated.h" // IWYU pragma: export +# include "os/process.c.generated.h" #endif #ifdef MSWIN @@ -114,6 +114,7 @@ bool os_proc_tree_kill(int pid, int sig) /// @param[out] proc_count Number of child processes. /// @return 0 on success, 1 if process not found, 2 on other error. int os_proc_children(int ppid, int **proc_list, size_t *proc_count) + FUNC_ATTR_NONNULL_ALL { if (ppid < 0) { return 2; diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index f801646967..d4be3086ea 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -35,7 +35,6 @@ #include "nvim/event/loop.h" #include "nvim/event/process.h" #include "nvim/event/stream.h" -#include "nvim/func_attr.h" #include "nvim/log.h" #include "nvim/os/fs.h" #include "nvim/os/os_defs.h" diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 191be784e8..cb8066a62d 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -20,7 +20,6 @@ #include "nvim/event/wstream.h" #include "nvim/ex_cmds.h" #include "nvim/fileio.h" -#include "nvim/func_attr.h" #include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/macros_defs.h" diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index c920cb655e..3a861b87b4 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -9,7 +9,6 @@ #include "nvim/autocmd.h" #include "nvim/eval.h" #include "nvim/event/signal.h" -#include "nvim/func_attr.h" #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/main.h" diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c index 7691aa5122..ede17bc7c8 100644 --- a/src/nvim/os/stdpaths.c +++ b/src/nvim/os/stdpaths.c @@ -4,13 +4,16 @@ #include "nvim/ascii_defs.h" #include "nvim/fileio.h" -#include "nvim/func_attr.h" #include "nvim/globals.h" #include "nvim/memory.h" #include "nvim/os/os.h" #include "nvim/os/stdpaths_defs.h" #include "nvim/path.h" +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/stdpaths.c.generated.h" +#endif + /// Names of the environment variables, mapped to XDGVarType values static const char *xdg_env_vars[] = { [kXDGConfigHome] = "XDG_CONFIG_HOME", diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index 49b43af6c0..7f3e44f680 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -8,7 +8,6 @@ #include "auto/config.h" #include "nvim/event/loop.h" -#include "nvim/func_attr.h" #include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/log.h" @@ -19,7 +18,7 @@ #include "nvim/os/time.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/time.c.generated.h" // IWYU pragma: export +# include "os/time.c.generated.h" #endif /// Gets a high-resolution (nanosecond), monotonically-increasing time relative diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index ae0994a73f..5db7a19411 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -22,6 +22,10 @@ # include "nvim/message.h" #endif +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "os/users.c.generated.h" +#endif + // All user names (for ~user completion as done by shell). static garray_T ga_users = GA_EMPTY_INIT_VALUE; |