aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-01-02 17:56:17 -0500
committerGitHub <noreply@github.com>2023-01-02 14:56:17 -0800
commita283a99165865e88ea8df366d1b2db290e9c637a (patch)
tree4f0db3b7879d2186544f14ec506f97ea93bfca76
parent5c6f2122ad65eb16786e7b4a7b0835b50f23f943 (diff)
downloadrneovim-a283a99165865e88ea8df366d1b2db290e9c637a.tar.gz
rneovim-a283a99165865e88ea8df366d1b2db290e9c637a.tar.bz2
rneovim-a283a99165865e88ea8df366d1b2db290e9c637a.zip
refactor: eliminate os_unix.c #21621
-rw-r--r--cmake.config/iwyu/mapping.imp1
-rw-r--r--src/nvim/fileio.c1
-rw-r--r--src/nvim/os/fs.c32
-rw-r--r--src/nvim/os_unix.c42
-rw-r--r--src/nvim/os_unix.h10
-rw-r--r--src/nvim/undo.c1
6 files changed, 32 insertions, 55 deletions
diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp
index 47f4274265..4cb2898c73 100644
--- a/cmake.config/iwyu/mapping.imp
+++ b/cmake.config/iwyu/mapping.imp
@@ -121,7 +121,6 @@
{ 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: [ '"os_unix.h.generated.h"', private, '"nvim/os_unix.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 ] },
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 6bad91e959..5e7c7cb943 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -52,7 +52,6 @@
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
-#include "nvim/os_unix.h"
#include "nvim/path.h"
#include "nvim/pos.h"
#include "nvim/regexp.h"
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 8c4fee58b1..4906dd0df2 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -779,6 +779,38 @@ int os_setperm(const char *const name, int perm)
return (r == kLibuvSuccess ? OK : FAIL);
}
+#if defined(HAVE_ACL)
+# ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+# endif
+# ifdef HAVE_SYS_ACCESS_H
+# include <sys/access.h>
+# endif
+
+// Return a pointer to the ACL of file "fname" in allocated memory.
+// Return NULL if the ACL is not available for whatever reason.
+vim_acl_T os_get_acl(const char_u *fname)
+{
+ vim_acl_T ret = NULL;
+ return ret;
+}
+
+// Set the ACL of file "fname" to "acl" (unless it's NULL).
+void os_set_acl(const char_u *fname, vim_acl_T aclent)
+{
+ if (aclent == NULL) {
+ return;
+ }
+}
+
+void os_free_acl(vim_acl_T aclent)
+{
+ if (aclent == NULL) {
+ return;
+ }
+}
+#endif
+
#ifdef UNIX
/// Checks if the current user owns a file.
///
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
deleted file mode 100644
index 074a8b7936..0000000000
--- a/src/nvim/os_unix.c
+++ /dev/null
@@ -1,42 +0,0 @@
-// This is an open source non-commercial project. Dear PVS-Studio, please check
-// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-
-#include "nvim/os/os_defs.h"
-#include "nvim/os_unix.h"
-#include "nvim/types.h"
-
-#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "os_unix.c.generated.h" // IWYU pragma: export
-#endif
-
-#if defined(HAVE_ACL)
-# ifdef HAVE_SYS_ACL_H
-# include <sys/acl.h>
-# endif
-# ifdef HAVE_SYS_ACCESS_H
-# include <sys/access.h>
-# endif
-
-// Return a pointer to the ACL of file "fname" in allocated memory.
-// Return NULL if the ACL is not available for whatever reason.
-vim_acl_T os_get_acl(const char_u *fname)
-{
- vim_acl_T ret = NULL;
- return ret;
-}
-
-// Set the ACL of file "fname" to "acl" (unless it's NULL).
-void os_set_acl(const char_u *fname, vim_acl_T aclent)
-{
- if (aclent == NULL) {
- return;
- }
-}
-
-void os_free_acl(vim_acl_T aclent)
-{
- if (aclent == NULL) {
- return;
- }
-}
-#endif
diff --git a/src/nvim/os_unix.h b/src/nvim/os_unix.h
deleted file mode 100644
index 31430ee23a..0000000000
--- a/src/nvim/os_unix.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef NVIM_OS_UNIX_H
-#define NVIM_OS_UNIX_H
-
-#include "nvim/os/shell.h"
-#include "nvim/types.h"
-
-#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "os_unix.h.generated.h"
-#endif
-#endif // NVIM_OS_UNIX_H
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 0777d1309d..9cbe5d5d9e 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -116,7 +116,6 @@
#include "nvim/os/os.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
-#include "nvim/os_unix.h"
#include "nvim/path.h"
#include "nvim/pos.h"
#include "nvim/screen.h"