tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3a2dca7eac5193cd9c1f2141850ad0f5ed1f6448

commit 3a2dca7eac5193cd9c1f2141850ad0f5ed1f6448
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Fri Jul 3 08:14:01 2015 +0200

    Evil: add a wrapper around _mkdir
    
    @feature
---
 src/lib/evil/Evil.h       |  2 --
 src/lib/evil/evil_stdio.c |  8 ++++++++
 src/lib/evil/evil_stdio.h | 20 ++++++++++++++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index e78dece..ff69452 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -105,7 +105,6 @@ extern "C" {
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <math.h>
-#include <direct.h>
 
 
 #ifdef _MSC_VER
@@ -187,7 +186,6 @@ typedef unsigned long  gid_t;
 #define S_IRWXO _S_IRWXU
 #define S_IRWXG _S_IRWXU
 
-#  define mkdir(p,m) _mkdir(p)
   /*
 #  define close(fd) _close(fd)
 #  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 40ea2fd..c30f0dc 100644
--- a/src/lib/evil/evil_stdio.c
+++ b/src/lib/evil/evil_stdio.c
@@ -2,6 +2,8 @@
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#include <direct.h>
+
 #include "Evil.h"
 #include "evil_private.h"
 
@@ -33,3 +35,9 @@ evil_rename(const char *src, const char* dst)
    return -1;
 }
 
+int
+evil_mkdir(const char *dirname, mode_t mode EVIL_UNUSED)
+{
+   return _mkdir(dirname);
+}
+
diff --git a/src/lib/evil/evil_stdio.h b/src/lib/evil/evil_stdio.h
index a964fef..f1de75a 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);
  */
 #define rename(src, dst) evil_rename(src, dst)
 
+/**
+ * @brief Wrap the _mkdir() function on Windows.
+ *
+ * @param[in] dirname The new dir name.
+ * @param[in] mode Unused.
+ * @return 0 on success, -1 otherwise.
+ *
+ * This function wraps the _mkdir() function.
+ *
+ * @since 1.15
+ */
+EAPI int evil_mkdir(const char *dirname, mode_t mode);
+
+/**
+ * @def mkdir(dirname, mode)
+ *
+ * Wrapper around evil_mkdir().
+ */
+#define mkdir(dirname, mode) evil_mkdir(dirname, mode)
+
 
 #endif /* __EVIL_STDIO_H__ */

-- 


Reply via email to