aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-11-26 21:36:02 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-11-27 15:50:45 +0100
commit40139738eb479d0913ec6ce751ca5adfa50ad8c3 (patch)
treee6b2928fad2afb74235316b31261e2c2d01dc047 /src/nvim/os
parent5b765fcab42308cd4d97a4c37da0c2b1cdb3514d (diff)
downloadrneovim-40139738eb479d0913ec6ce751ca5adfa50ad8c3.tar.gz
rneovim-40139738eb479d0913ec6ce751ca5adfa50ad8c3.tar.bz2
rneovim-40139738eb479d0913ec6ce751ca5adfa50ad8c3.zip
build: enable IWYU on mac
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/fileio.c4
-rw-r--r--src/nvim/os/fs.c2
-rw-r--r--src/nvim/os/process.c12
-rw-r--r--src/nvim/os/signal.c6
-rw-r--r--src/nvim/os/time.c2
-rw-r--r--src/nvim/os/unix_defs.h17
6 files changed, 28 insertions, 15 deletions
diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c
index b205481e98..55c12f2986 100644
--- a/src/nvim/os/fileio.c
+++ b/src/nvim/os/fileio.c
@@ -28,6 +28,10 @@
# include "nvim/os/os_win_console.h"
#endif
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/fileio.c.generated.h"
#endif
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index b9448ddf4b..4721bc3f1c 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -67,8 +67,6 @@ static const char e_xattr_other[]
= N_("E1509: Error occurred when reading or writing extended attribute");
#endif
-struct iovec;
-
#define RUN_UV_FS_FUNC(ret, func, ...) \
do { \
uv_fs_t req; \
diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index 889d1f453f..7b47ba7020 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -3,18 +3,19 @@
/// psutil is a good reference for cross-platform syscall voodoo:
/// https://github.com/giampaolo/psutil/tree/master/psutil/arch
+// IWYU pragma: no_include <sys/param.h>
+
#include <assert.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
-#include <stdio.h>
#include <uv.h>
#ifdef MSWIN
# include <tlhelp32.h>
#endif
-#if defined(__FreeBSD__) // XXX: OpenBSD ?
+#if defined(__FreeBSD__)
# include <string.h>
# include <sys/types.h>
# include <sys/user.h>
@@ -25,8 +26,13 @@
#endif
#if defined(__APPLE__) || defined(BSD)
-# include <pwd.h>
# include <sys/sysctl.h>
+
+# include "nvim/macros.h"
+#endif
+
+#if defined(__linux__)
+# include <stdio.h>
#endif
#include "nvim/log.h"
diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c
index e73a579a27..3a861b87b4 100644
--- a/src/nvim/os/signal.c
+++ b/src/nvim/os/signal.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
+
#ifndef MSWIN
# include <signal.h>
#endif
@@ -11,9 +12,12 @@
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/main.h"
-#include "nvim/memline.h"
#include "nvim/os/signal.h"
+#ifdef SIGPWR
+# include "nvim/memline.h"
+#endif
+
static SignalWatcher spipe, shup, squit, sterm, susr1, swinch;
#ifdef SIGPWR
static SignalWatcher spwr;
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c
index 8aa3170963..be95412c01 100644
--- a/src/nvim/os/time.c
+++ b/src/nvim/os/time.c
@@ -17,8 +17,6 @@
#include "nvim/os/os.h"
#include "nvim/os/time.h"
-struct tm;
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/time.c.generated.h" // IWYU pragma: export
#endif
diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h
index fe5dce5655..d2bec7b361 100644
--- a/src/nvim/os/unix_defs.h
+++ b/src/nvim/os/unix_defs.h
@@ -1,15 +1,18 @@
#pragma once
// IWYU pragma: private, include "nvim/os/os_defs.h"
-#include <sys/param.h> // IWYU pragma: export
-#include <sys/socket.h> // IWYU pragma: export
-#include <unistd.h> // IWYU pragma: export
+// IWYU pragma: begin_exports
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <pthread.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <unistd.h>
#if defined(HAVE_TERMIOS_H)
-# include <termios.h> // IWYU pragma: export
+# include <termios.h>
#endif
-
-// POSIX.1-2008 says that NAME_MAX should be in here
-#include <limits.h>
+// IWYU pragma: end_exports
#define TEMP_DIR_NAMES { "$TMPDIR", "/tmp", ".", "~" }
#define TEMP_FILE_PATH_MAXLEN 256