summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2015-07-03 08:14:01 +0200
committerTom Hacohen <tom@stosb.com>2015-07-03 16:23:06 +0100
commit3a2dca7eac5193cd9c1f2141850ad0f5ed1f6448 (patch)
treecaec7ebcaea5b9db4acf00d6a3b541a91fc83bf9 /src/lib/evil
parent9846976847c7a3a515ee67c1c178e6fb53707ddd (diff)
Evil: add a wrapper around _mkdir
@feature
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/Evil.h2
-rw-r--r--src/lib/evil/evil_stdio.c8
-rw-r--r--src/lib/evil/evil_stdio.h20
3 files changed, 28 insertions, 2 deletions
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index e78deceffd..ff694527d9 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -105,7 +105,6 @@ extern "C" {
105#include <sys/stat.h> 105#include <sys/stat.h>
106#include <fcntl.h> 106#include <fcntl.h>
107#include <math.h> 107#include <math.h>
108#include <direct.h>
109 108
110 109
111#ifdef _MSC_VER 110#ifdef _MSC_VER
@@ -187,7 +186,6 @@ typedef unsigned long gid_t;
187#define S_IRWXO _S_IRWXU 186#define S_IRWXO _S_IRWXU
188#define S_IRWXG _S_IRWXU 187#define S_IRWXG _S_IRWXU
189 188
190# define mkdir(p,m) _mkdir(p)
191 /* 189 /*
192# define close(fd) _close(fd) 190# define close(fd) _close(fd)
193# define read(fd,buffer,count) _read((fd),(buffer),(count)) 191# define read(fd,buffer,count) _read((fd),(buffer),(count))
diff --git a/src/lib/evil/evil_stdio.c b/src/lib/evil/evil_stdio.c
index 40ea2fd3a6..c30f0dce23 100644
--- a/src/lib/evil/evil_stdio.c
+++ b/src/lib/evil/evil_stdio.c
@@ -2,6 +2,8 @@
2# include "config.h" 2# include "config.h"
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include <direct.h>
6
5#include "Evil.h" 7#include "Evil.h"
6#include "evil_private.h" 8#include "evil_private.h"
7 9
@@ -33,3 +35,9 @@ evil_rename(const char *src, const char* dst)
33 return -1; 35 return -1;
34} 36}
35 37
38int
39evil_mkdir(const char *dirname, mode_t mode EVIL_UNUSED)
40{
41 return _mkdir(dirname);
42}
43
diff --git a/src/lib/evil/evil_stdio.h b/src/lib/evil/evil_stdio.h
index a964fefb20..f1de75a4ff 100644
--- a/src/lib/evil/evil_stdio.h
+++ b/src/lib/evil/evil_stdio.h
@@ -51,5 +51,25 @@ EAPI int evil_rename(const char *src, const char *dst);
51 */ 51 */
52#define rename(src, dst) evil_rename(src, dst) 52#define rename(src, dst) evil_rename(src, dst)
53 53
54/**
55 * @brief Wrap the _mkdir() function on Windows.
56 *
57 * @param[in] dirname The new dir name.
58 * @param[in] mode Unused.
59 * @return 0 on success, -1 otherwise.
60 *
61 * This function wraps the _mkdir() function.
62 *
63 * @since 1.15
64 */
65EAPI int evil_mkdir(const char *dirname, mode_t mode);
66
67/**
68 * @def mkdir(dirname, mode)
69 *
70 * Wrapper around evil_mkdir().
71 */
72#define mkdir(dirname, mode) evil_mkdir(dirname, mode)
73
54 74
55#endif /* __EVIL_STDIO_H__ */ 75#endif /* __EVIL_STDIO_H__ */