aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authorPavel Platto <hinidu@gmail.com>2014-06-19 00:58:04 +0300
committerNicolas Hillegeer <nicolas@hillegeer.com>2014-07-14 21:14:39 +0200
commitedd7a8c5ddd99bd0c02b4218d43bccb562809d55 (patch)
tree764a6762ee492e3589c209fd1d34559addcc70ab /src/nvim/os
parented10eb6fa92989d5a3841bf225a38b524c910e2e (diff)
downloadrneovim-edd7a8c5ddd99bd0c02b4218d43bccb562809d55.tar.gz
rneovim-edd7a8c5ddd99bd0c02b4218d43bccb562809d55.tar.bz2
rneovim-edd7a8c5ddd99bd0c02b4218d43bccb562809d55.zip
Remove #ifdefs TEMPDIRNAMES and add TEMPDIRNAMES for Windows
Vim does not define TEMPDIRNAMES for all systems, but it is defined for all systems supported by Neovim. Temporary directory names for Windows was obtained from GetTempPath() function documentation at MSDN. Additionally small renamings were performed.
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/os.h7
-rw-r--r--src/nvim/os/unix_defs.h7
-rw-r--r--src/nvim/os/win_defs.h9
3 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h
index b6148e72bf..b46989d9b4 100644
--- a/src/nvim/os/os.h
+++ b/src/nvim/os/os.h
@@ -7,10 +7,17 @@
#include "nvim/os/fs_defs.h"
#include "nvim/vim.h"
+#ifdef WIN32
+# include "nvim/os/win_defs.h"
+#else
+# include "nvim/os/unix_defs.h"
+#endif
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/fs.h.generated.h"
# include "os/mem.h.generated.h"
# include "os/env.h.generated.h"
# include "os/users.h.generated.h"
#endif
+
#endif // NVIM_OS_OS_H
diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h
new file mode 100644
index 0000000000..197a87bcc5
--- /dev/null
+++ b/src/nvim/os/unix_defs.h
@@ -0,0 +1,7 @@
+#ifndef NEOVIM_OS_UNIX_DEFS_H
+#define NEOVIM_OS_UNIX_DEFS_H
+
+#define TEMP_DIR_NAMES {"$TMPDIR", "/tmp", ".", "$HOME"}
+#define TEMP_FILE_PATH_MAXLEN 256
+
+#endif // NEOVIM_OS_UNIX_DEFS_H
diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h
new file mode 100644
index 0000000000..49fcb64777
--- /dev/null
+++ b/src/nvim/os/win_defs.h
@@ -0,0 +1,9 @@
+#ifndef NEOVIM_OS_WIN_DEFS_H
+#define NEOVIM_OS_WIN_DEFS_H
+
+#include <windows.h>
+
+#define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""}
+#define TEMP_FILE_PATH_MAXLEN _MAX_PATH
+
+#endif // NEOVIM_OS_WIN_DEFS_H