aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/env.c5
-rw-r--r--src/nvim/os/fs.c1
-rw-r--r--src/nvim/os/input.c1
-rw-r--r--src/nvim/os/os_defs.h28
-rw-r--r--src/nvim/os/process.c3
-rw-r--r--src/nvim/os/pty_process_unix.c1
-rw-r--r--src/nvim/os/shell.c1
-rw-r--r--src/nvim/os/signal.c1
-rw-r--r--src/nvim/os/stdpaths.c5
-rw-r--r--src/nvim/os/time.c3
-rw-r--r--src/nvim/os/users.c4
11 files changed, 43 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/os_defs.h b/src/nvim/os/os_defs.h
index 12de55a227..db575e005a 100644
--- a/src/nvim/os/os_defs.h
+++ b/src/nvim/os/os_defs.h
@@ -113,3 +113,31 @@
&& (defined(S_ISCHR) || defined(S_IFCHR))
# define OPEN_CHR_FILES
#endif
+
+// We use 64-bit file functions here, if available. E.g. ftello() returns
+// off_t instead of long, which helps if long is 32 bit and off_t is 64 bit.
+// We assume that when fseeko() is available then ftello() is too.
+// Note that Windows has different function names.
+#if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
+typedef __int64 off_T;
+# ifdef __MINGW32__
+# define vim_lseek lseek64
+# define vim_fseek fseeko64
+# define vim_ftell ftello64
+# else
+# define vim_lseek _lseeki64
+# define vim_fseek _fseeki64
+# define vim_ftell _ftelli64
+# endif
+#else
+typedef off_t off_T;
+# ifdef HAVE_FSEEKO
+# define vim_lseek lseek
+# define vim_ftell ftello
+# define vim_fseek fseeko
+# else
+# define vim_lseek lseek
+# define vim_ftell ftell
+# define vim_fseek(a, b, c) fseek(a, (long)b, c)
+# endif
+#endif
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;